From 0280ecc2c7dd773198db67eb8a4423573795f6c8 Mon Sep 17 00:00:00 2001 From: Mehdi Samsami Date: Thu, 3 Jul 2025 12:43:30 +0330 Subject: [PATCH] use yield from for generator methods in _DenseAdaBoostClassifier --- src/linearboost/linear_boost.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/linearboost/linear_boost.py b/src/linearboost/linear_boost.py index 0967008..d15c151 100644 --- a/src/linearboost/linear_boost.py +++ b/src/linearboost/linear_boost.py @@ -145,7 +145,7 @@ def staged_score(self, X, y, sample_weight=None): ------ z : float """ - return super().staged_score(X, y, sample_weight) + yield from super().staged_score(X, y, sample_weight) def staged_predict(self, X): """Return staged predictions for X. @@ -167,7 +167,7 @@ def staged_predict(self, X): y : generator of ndarray of shape (n_samples,) The predicted classes. """ - return super().staged_predict(X) + yield from super().staged_predict(X) def staged_decision_function(self, X): """Compute decision function of ``X`` for each boosting iteration. @@ -190,7 +190,7 @@ def staged_decision_function(self, X): values closer to -1 or 1 mean more like the first or second class in ``classes_``, respectively. """ - return super().staged_decision_function(X) + yield from super().staged_decision_function(X) def predict_proba(self, X): """Predict class probabilities for X. @@ -235,7 +235,7 @@ def staged_predict_proba(self, X): The class probabilities of the input samples. The order of outputs is the same of that of the :term:`classes_` attribute. """ - return super().staged_predict_proba(X) + yield from super().staged_predict_proba(X) def predict_log_proba(self, X): """Predict class log-probabilities for X.