【发布时间】:2021-10-21 02:40:52
【问题描述】:
我想在 sklearn 中使用 shape 功能作为 list,可以吗? 使用 MLPClassifier
鉴于此输入。
data=[{'forniture':1,'color':3, 'shape':[0.2,0.5,1.1]},
{'forniture':2,'color':0, 'shape':[0.2,0.7,0.9]},
{'forniture':2,'color':1, 'shape':[1.2,1.5,1.0]}]
pd.DataFrame(data)
退出
forniture color shape
0 1 3 [0.2, 0.5, 1.1]
1 2 0 [0.2, 0.7, 0.9]
2 2 1 [1.2, 1.5, 1.0]
当我在 clf.fit() 中将 shape 作为参数传递时:
TypeError: float() 参数必须是字符串或数字,而不是“列表”
但我需要整个列表,因为它是形状,我不能像 Volume 一样转换为标量。
有什么适合形状而不是体积的建议吗?
谢谢,非常感谢您的帮助。
【问题讨论】:
标签: python pandas machine-learning scikit-learn mlp