0

我正在使用 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."

有什么我想念的吗?

4

1 回答 1

1

尝试通过graphlab而不是sframe加载数据

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

model = graphlab.logistic_classifier.create(train_data, target='sentiment')
于 2016-03-27T23:19:12.720 回答