Stephen Hage
Stephen Hage

Reputation: 11

Creating sframe logistic classifier

I'm using graphlab-create to build a logistic classifier. My data is in an sframe (I've checked this using .dtype) This is for a Coursera class on machine learning using a zip file of Amazon reviews:

products = sframe.SFrame('amazon_baby.gl/'
products = products[products['rating'] != 3]
products['sentiment'] = products['rating'].apply(lambda rating : +1 if rating > 3 else -1)

However when I run this code:

model = gl.logistic_classifier.create(train_data, target='sentiment')
I get the error "ToolkitError: Input training dataset is not an SFrame. If it is a Pandas DataFrame, you may use the to_sframe() function to convert it to an SFrame."

Is there something I am missing?

Upvotes: 0

Views: 447

Answers (1)

Mohamed Abdallah
Mohamed Abdallah

Reputation: 33

Try to load the data by graphlab instead of sframe

import graphlab products = graphlab.SFrame('amazon_baby.gl/')

model = graphlab.logistic_classifier.create(train_data, target='sentiment')

Upvotes: 1

Related Questions