From 62610b091d929b04087869e45d5bf4658e81e0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Wed, 28 Mar 2018 10:05:03 +0200 Subject: [PATCH] Replace inner1d by standard numpy constructs. numpy.core.umath_tests has been moved to private modules in numpy dev. --- sklearn/ensemble/weight_boosting.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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: