0
我preparting数据从Graphlab运行KMEAMS,和我遇到了以下错误:SFrame K均值 - 隐蔽到整型,浮点型,快译通
tmp = data.select_columns(['a.item_id'])
tmp['sku'] = tmp['a.item_id'].apply(lambda x: x.split(','))
tmp = tmp.unpack('sku')
kmeans_model = gl.kmeans.create(tmp, num_clusters=K)
Feature 'sku.0' excluded because of its type. Kmeans features must be int, float, dict, or array.array type.
Feature 'sku.1' excluded because of its type. Kmeans features must be int, float, dict, or array.array type.
这里是每一列的数据类型电流:
a.item_id str
sku.0 str
sku.1 str
如果我可以从str到int的数据类型我认为它应该工作。但是,使用SFrames比标准的python库更棘手。任何帮助到达那里都表示赞赏。