决策树模型C50错误

时间:2018-08-23 13:37:28

标签: python

#Divide data into train and test
X = Train_data.values[:, 0:15]
Y = Train_data.values[:,15]

X_train, X_test, y_train, y_test = train_test_split( X, Y, test_size = 0.2)
#Decision Tree
C50_model = tree.DecisionTreeClassifier(criterion='entropy').fit(X_train, y_train)

对于此代码,我收到一条错误消息,

ValueError: could not convert string to float: ' no'

任何人都可以帮忙,或者为决策树提供更好的代码吗?

0 个答案:

没有答案