0

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?

  • you showed how you define the `products` variable, but in your model you use `train_data`. can you show how `training_data` is defined? – iulian Mar 27 '16 at 20:07

1 Answers1

1

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')