SFrame' object has no attribute 'evaluate'?

User 5323 | 7/8/2016, 1:22:21 PM

train_data,test_data = products.random_split(.8, seed=0)

selected_words_model = graphlab.logistic_classifier.create(train_data,target='sentiment',features=selected_words,validation_set=test_data)

selected_words_model = selected_words_model['coefficients'].sort('value')

selected_words_model.evaluate(test_data, metric='roc_curve')

AttributeError Traceback (most recent call last) <ipython-input-23-86924203df2e> in <module>() ----> 1 selectedwordsmodel.evaluate(testdata, metric='roccurve')

AttributeError: 'SFrame' object has no attribute 'evaluate'

I really don't know why i keep getting this error. I ran the evaluate function before while applying linear regression and simple logistic regression but it never showed this error. What can i do to fix this bug?

Comments

User 91 | 7/8/2016, 3:22:56 PM

When you did the following selected_words_model = selected_words_model['coefficients'].sort('value') you mutated the model into an SFrame which then caused the following line to fail. I would suggest saving the result of the above line into a new variable.