8000 MNT Deprecate SAMME.R algorithm from AdaBoostClassifier by StefanieSenger · Pull Request #26830 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MNT Deprecate SAMME.R algorithm from AdaBoostClassifier #26830

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 9 commits into from
Sep 7, 2023
2 changes: 1 addition & 1 deletion benchmarks/bench_20newsgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"extra_trees": ExtraTreesClassifier(max_features="sqrt", min_samples_split=10),
"logistic_regression": LogisticRegression(),
"naive_bayes": MultinomialNB(),
"adaboost": AdaBoostClassifier(n_estimators=10),
"adaboost": AdaBoostClassifier(n_estimators=10, algorithm="SAMME"),
}


Expand Down
3 changes: 3 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@
"auto_examples/decomposition/plot_beta_divergence": (
"auto_examples/applications/plot_topics_extraction_with_nmf_lda"
),
"auto_examples/ensemble/plot_adaboost_hastie_10_2": (
"auto_examples/ensemble/plot_adaboost_multiclass"
),
}
html_context["redirects"] = redirects
for old_link in redirects:
Expand Down
15 changes: 5 additions & 10 deletions doc/modules/ensemble.rst
8000
Original file line number Diff line numberDiff line change
Expand Up @@ -1570,15 +1570,15 @@ ever-increasing influence. Each subsequent weak learner is thereby forced to
concentrate on the examples that are missed by the previous ones in the sequence
[HTF]_.

.. figure:: ../auto_examples/ensemble/images/sphx_glr_plot_adaboost_hastie_10_2_001.png
:target: ../auto_examples/ensemble/plot_adaboost_hastie_10_2.html
.. figure:: ../auto_examples/ensemble/images/sphx_glr_plot_adaboost_multiclass_001.png
:target: ../auto_examples/ensemble/plot_adaboost_multiclass.html
:align: center
:scale: 75

AdaBoost can be used both for classification and regression problems:

- For multi-class classification, :class:`AdaBoostClassifier` implements
AdaBoost-SAMME and AdaBoost-SAMME.R [ZZRH2009]_.
AdaBoost.SAMME [ZZRH2009]_.

- For regression, :class:`AdaBoostRegressor` implements AdaBoost.R2 [D1997]_.

Expand All @@ -1593,7 +1593,7 @@ learners::
>>> from sklearn.ensemble import AdaBoostClassifier

>>> X, y = load_iris(return_X_y=True)
>>> clf = AdaBoostClassifier(n_estimators=100)
>>> clf = AdaBoostClassifier(n_estimators=100, algorithm="SAMME",)
>>> scores = cross_val_score(clf, X, y, cv=5)
>>> scores.mean()
0.9...
Expand All @@ -1608,12 +1608,8 @@ minimum required number of samples to consider a split ``min_samples_split``).

.. topic:: Examples:

* :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_hastie_10_2.py` compares the
classification error of a decision stump, decision tree, and a boosted
decision stump using AdaBoost-SAMME and AdaBoost-SAMME.R.

* :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_multiclass.py` shows the performance
of AdaBoost-SAMME and AdaBoost-SAMME.R on a multi-class problem.
of AdaBoost on a multi-class problem.

* :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_twoclass.py` shows the decision boundary
and decision function values for a non-linearly separable two-class problem
Expand All @@ -1634,4 +1630,3 @@ minimum required number of samples to consider a split ``min_samples_split``).

.. [HTF] T. Hastie, R. Tibshirani and J. Friedman, "Elements of
Statistical Learning Ed. 2", Springer, 2009.

4 changes: 4 additions & 0 deletions doc/whats_new/v1.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ Changelog
:pr:`13649` by :user:`Samuel Ronsin <samronsin>`,
initiated by :user:`Patrick O'Reilly <pat-oreilly>`.

- |API| In :class:`AdaBoostClassifier`, the `algorithm` argument `SAMME.R` was
deprecated and will be removed in 1.6. :pr:`26830` by :user:`Stefanie Senger
<StefanieSenger>`.

- |Efficiency| :class:`ensemble.GradientBoostingClassifier` is faster,
for binary and in particular for multiclass problems thanks to the private loss
function module.
Expand Down
2 changes: 1 addition & 1 deletion examples/classification/plot_classifier_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
max_depth=5, n_estimators=10, max_features=1, random_state=42
),
MLPClassifier(alpha=1, max_iter=1000, random_state=42),
AdaBoostClassifier(random_state=42),
AdaBoostClassifier(algorithm="SAMME", random_state=42),
GaussianNB(),
QuadraticDiscriminantAnalysis(),
]
Expand Down
172 changes: 0 additions & 172 deletions examples/ensemble/plot_adaboost_hastie_10_2.py

This file was deleted.

6 changes: 5 additions & 1 deletion examples/ensemble/plot_forest_iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@
DecisionTreeClassifier(max_depth=None),
RandomForestClassifier(n_estimators=n_estimators),
ExtraTreesClassifier(n_estimators=n_estimators),
AdaBoostClassifier(DecisionTreeClassifier(max_depth=3), n_estimators=n_estimators),
AdaBoostClassifier(
DecisionTreeClassifier(max_depth=3),
n_estimators=n_estimators,
algorithm="SAMME",
),
]

for pair in ([0, 1], [0, 2], [2, 3]):
Expand Down
Loading
0