Skip to content

DOC Ensures that AdaBoostRegressor passes numpydoc validation #20400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

# List of modules ignored when checking for numpydoc validation.
DOCSTRING_IGNORE_LIST = [
"AdaBoostRegressor",
"AdditiveChi2Sampler",
"AffinityPropagation",
"AgglomerativeClustering",
Expand Down
29 changes: 15 additions & 14 deletions sklearn/ensemble/_weight_boosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ class AdaBoostRegressor(RegressorMixin, BaseWeightBoosting):
The maximum number of estimators at which boosting is terminated.
In case of perfect fit, the learning procedure is stopped early.

learning_rate : float, default=1.
learning_rate : float, default=1.0
Weight applied to each classifier at each boosting iteration. A higher
learning rate increases the contribution of each classifier. There is
a trade-off between the `learning_rate` and `n_estimators` parameters.
Expand Down Expand Up @@ -969,6 +969,19 @@ class AdaBoostRegressor(RegressorMixin, BaseWeightBoosting):

.. versionadded:: 0.24

See Also
--------
AdaBoostClassifier : An AdaBoost classifier.
GradientBoostingRegressor : Gradient Boosting Classification Tree.
sklearn.tree.DecisionTreeRegressor : A decision tree regressor.

References
----------
.. [1] Y. Freund, R. Schapire, "A Decision-Theoretic Generalization of
on-Line Learning and an Application to Boosting", 1995.

.. [2] H. Drucker, "Improving Regressors using Boosting Techniques", 1997.

Examples
--------
>>> from sklearn.ensemble import AdaBoostRegressor
Expand All @@ -982,19 +995,6 @@ class AdaBoostRegressor(RegressorMixin, BaseWeightBoosting):
array([4.7972...])
>>> regr.score(X, y)
0.9771...

See Also
--------
AdaBoostClassifier, GradientBoostingRegressor,
sklearn.tree.DecisionTreeRegressor

References
----------
.. [1] Y. Freund, R. Schapire, "A Decision-Theoretic Generalization of
on-Line Learning and an Application to Boosting", 1995.

.. [2] H. Drucker, "Improving Regressors using Boosting Techniques", 1997.

"""

def __init__(
Expand Down Expand Up @@ -1036,6 +1036,7 @@ def fit(self, X, y, sample_weight=None):
Returns
-------
self : object
Fitted AdaBoostRegressor estimator.
"""
# Check loss
if self.loss not in ("linear", "square", "exponential"):
Expand Down