我正在使用graphlab-create构建一个逻辑分类器。我的数据是在一个sframe中(我已经使用.dtype检查了这个)这是一个使用亚马逊评论的zip文件进行机器学习的Coursera课程:
products = sframe.SFrame('amazon_baby.gl/'
products = products[products['rating'] != 3]
products['sentiment'] = products['rating'].apply(lambda rating : +1 if rating > 3 else -1)
但是,当我运行此代码时:
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."
我有什么遗失的吗?
答案 0 :(得分:1)
尝试通过graphlab而不是sframe加载数据
import graphlab
products = graphlab.SFrame('amazon_baby.gl/')
model = graphlab.logistic_classifier.create(train_data, target='sentiment')