[MRG+1] Voting Classifier: predictions are float but np.bincount can only be used on integers#5802
Conversation
…hus an error comes out when using it
|
Looks good to me. +1 Can you confirm @rasbt ? |
|
Certainly doesn't hurt in case someone uses float arrays to store class labels. That's actually a good idea, thanks for the fix! I remember the "type in -- type out" discussion ;) |
True, except that the classifiers are internally trained on the LabelEncoded outputs, so it should still spit the same format, even with this fix. |
[MRG+1] Voting Classifier: predictions are float but np.bincount can only be used on integers
|
no regression test? :-/ |
|
@amueller you mean that we should raise an exception if someone tries to seed it with an estimator for regression? |
|
do you have full code example how it works On Sun, Jan 24, 2016 at 1:37 PM, Sebastian Raschka <notifications@github.com
|
What do you mean, exactly? A code example for raising the exception? |
|
code example for Voting Classifier On Sun, Jan 24, 2016 at 1:50 PM, Sebastian Raschka <notifications@github.com
|
|
@Sandy4321 there are plenty of examples in the documentation at http://scikit-learn.org/stable/modules/ensemble.html#voting-classifier (or also see the respective unit tests) |
|
(As well as the regression test), I think this needs a what's new entry. |
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
… classifier (scikit-learn#9063) * FIX/TST revert scikit-learn#5802 and raise error for faulty classifier * FIX check_estimator take care of the rest
This fix downcasts manually the array of predictions to integers so that np.bincount does not trigger an error