is it a bug?
See original GitHub issueDescription
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
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Identifying a Bug vs Insect - ThoughtCo
Technically, or taxonomically, a bug is a creature that belongs to the insect order Hemiptera, known commonly as the true bugs. Aphids, cicadas, ......
Read more >Is It a Feature? Is it a Bug? No, It's an Antifeature.
A bug is a behavior, usually the result of an error or sloppy programming, that gets in the way of the features. Antifeatures,...
Read more >What is a bug (computer bug)? - TechTarget
In computer technology, a bug is a coding error in a computer program. (We consider a program to also include the microcode that...
Read more >'It's Not a Bug, It's a Feature.' Trite—or Just Right? - WIRED
A standard joke is that a bug can be turned into a feature simply by documenting it (then theoretically no one can complain...
Read more >What Makes a Bug a True Bug? - VPM
To them, a true bug refers only to members of Hemiptera, an order of insects that also includes cicadas, hoppers, and aphids.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
encoding the targets as one-hot indicates to the estimator that you want it treated as a multi-label problem.
oh, thanks