简单的决策树

1 #简单的决策树分类
2 from sklearn import tree
3 features = [[300,2],[450,2],[200,8],[150,9]]
4 labels = ['apple','apple','orange','orange']
5 clf = tree.DecisionTreeClassifier()
6 clf = clf.fit(features,labels)
7 print(clf.predict([[400,6]]))

猜你喜欢

转载自www.cnblogs.com/caioo0/p/9565320.html
今日推荐