diff --git a/sklearn/ensemble/weight_boosting.py b/sklearn/ensemble/weight_boosting.py index b75e607b5b463..f13d16befb140 100644 --- a/sklearn/ensemble/weight_boosting.py +++ b/sklearn/ensemble/weight_boosting.py @@ -26,7 +26,6 @@ from abc import ABCMeta, abstractmethod import numpy as np -from numpy.core.umath_tests import inner1d from .base import BaseEnsemble from ..base import ClassifierMixin, RegressorMixin, is_regressor, is_classifier @@ -522,8 +521,8 @@ def _boost_real(self, iboost, X, y, sample_weight, random_state): # Boost weight using multi-class AdaBoost SAMME.R alg estimator_weight = (-1. * self.learning_rate - * (((n_classes - 1.) / n_classes) * - inner1d(y_coding, np.log(y_predict_proba)))) + * ((n_classes - 1.) / n_classes) + * (y_coding * np.log(y_predict_proba)).sum(axis=1)) # Only boost the weights if it will fit again if not iboost == self.n_estimators - 1: