【发布时间】:2016-03-18 21:37:08
【问题描述】:
我正在使用 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."
我有什么遗漏吗?
【问题讨论】:
-
您展示了如何定义
products变量,但在您的模型中您使用train_data。你能说明training_data是如何定义的吗?