Skip to content
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

FIX make sure the decision function of weak learner is symmetric #26521

Merged
merged 6 commits into from Sep 1, 2023

Conversation

glemaitre
Copy link
Member

@glemaitre glemaitre commented Jun 5, 2023

closes #26520

From the original paper, when considering the multiclass exponential-loss, it is expected that the decision function of each weak-learner to be symmetric around zero.

image

It concretely means that the predicted class should be (n_classes - 1) / n_classes * weight and the other classes -1 / n_classes * weight.

This PR correct the decision_function and the staged_decision_function and add a non-regression case where we use a single learner to make sure that we respect this constraint.

@glemaitre
Copy link
Member Author

Since this is a bug that I found while looking at #26486, maybe @adrinjalali and @StefanieSenger are interested to look at it.

(My next step is to open an issue and ask to deprecate completely SAMME.R because it is actually an unpublished algorithm that triggers some divergent behaviour).

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my!

sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/_weight_boosting.py Outdated Show resolved Hide resolved
glemaitre and others added 2 commits June 14, 2023 11:12
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
doc/whats_new/v1.3.rst Outdated Show resolved Hide resolved
@jeremiedbb
Copy link
Member

@ogrisel do you agree with the last changes ?

@glemaitre
Copy link
Member Author

Solved the conflicts

@github-actions
Copy link

github-actions bot commented Jul 11, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: fbffc9b. Link to the linter CI: here

@jeremiedbb jeremiedbb added this to the 1.3.1 milestone Jul 13, 2023
Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. However I made a mistaken when resolving the changelog conflict. Let me push a fix before merging.

@ogrisel ogrisel enabled auto-merge (squash) September 1, 2023 12:24
@ogrisel ogrisel merged commit 9f03c03 into scikit-learn:main Sep 1, 2023
25 checks passed
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Sep 5, 2023
…kit-learn#26521)

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Sep 18, 2023
…kit-learn#26521)

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
jeremiedbb added a commit that referenced this pull request Sep 20, 2023
)

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
…kit-learn#26521)

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in the decision function of AdaBoost SAMME
4 participants