Python错误TypeError:fit()缺少2个必需的位置参数:“ X”和“ y”

时间:2020-01-25 00:00:29

标签: python python-3.x scikit-learn

我的错误代码是TypeError:fit()缺少2个必需的位置参数:'X'和'y'

这是我的代码

from sklearn import tree

#[height,weight,shoe size]

X = [181,80,44], [177,70,43], [160,60,38], [154, 54,37]

Y = ['male','female','female','female']

clf = tree.DecisionTreeClassifier

clf = clf.fit(X,Y)

prediciton = clf.predict([[190,70,43]])

'print'(prediciton)

0 个答案:

没有答案