From a161f2c2c2045ac22a17f8cb0d78f204ae10e7e0 Mon Sep 17 00:00:00 2001 From: Alvaro Ulloa Date: Thu, 12 Nov 2015 09:30:08 -0700 Subject: [PATCH] predictions are float but np.bincount can only be used on integers, thus an error comes out when using it --- sklearn/ensemble/voting_classifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/ensemble/voting_classifier.py b/sklearn/ensemble/voting_classifier.py index 17540f2b5e7e8..4cdfa892bfe46 100644 --- a/sklearn/ensemble/voting_classifier.py +++ b/sklearn/ensemble/voting_classifier.py @@ -150,7 +150,7 @@ def predict(self, X): np.argmax(np.bincount(x, weights=self.weights)), axis=1, - arr=predictions) + arr=predictions.astype('int')) maj = self.le_.inverse_transform(maj)