-
-
Notifications
You must be signed in to change notification settings - Fork 26.4k
Closed
Description
Description
an err output, In my train_output, it does not exist [0,0]
Steps/Code to Reproduce
from sklearn import tree
X = [[1, 1], [1, 2], [1, 3], [1, 4], [2, 1], [2, 2], [2, 3], [2, 4]]
Y = [[0, 1], [0, 1], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]
# Y = [[0], [0], [1], [1], [1], [1], [1], [1]]
clf = tree.DecisionTreeClassifier(criterion='entropy', max_depth=1)
clf.fit(X, Y)
print(clf.predict([[1, 1], [1, 2], [1, 3], [1, 4], [2, 1], [2, 2], [2, 3], [2, 4]]))
Expected Results
[[ 0. 1.]
[ 0. 1.]
[ 0. 1.]
[ 0. 1.]
[ 1. 0.]
[ 1. 0.]
[ 1. 0.]
[ 1. 0.]]
Actual Results
[[ 0. 0.]
[ 0. 0.]
[ 0. 0.]
[ 0. 0.]
[ 1. 0.]
[ 1. 0.]
[ 1. 0.]
[ 1. 0.]]
Versions
Darwin-16.7.0-x86_64-i386-64bit
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
NumPy 1.13.3
SciPy 0.19.1
Scikit-Learn 0.19.0
Metadata
Metadata
Assignees
Labels
No labels