Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
ogrisel merged 6 commits into
scikit-learn:mainfrom
glemaitre:is/26520
Sep 1, 2023
Merged

FIX make sure the decision function of weak learner is symmetric#26521
ogrisel merged 6 commits into
scikit-learn:mainfrom
glemaitre:is/26520

Conversation

@glemaitre

@glemaitre glemaitre commented Jun 5, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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).

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh my!

Comment thread sklearn/ensemble/tests/test_weight_boosting.py Outdated
Comment thread sklearn/ensemble/_weight_boosting.py
Comment thread sklearn/ensemble/_weight_boosting.py
Comment thread sklearn/ensemble/_weight_boosting.py
Comment thread sklearn/ensemble/tests/test_weight_boosting.py
Comment thread doc/whats_new/v1.3.rst Outdated
@jeremiedbb

Copy link
Copy Markdown
Member

@ogrisel do you agree with the last changes ?

@glemaitre

Copy link
Copy Markdown
Member Author

Solved the conflicts

@github-actions

github-actions Bot commented Jul 11, 2023

Copy link
Copy Markdown

✔️ 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

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

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
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Sep 5, 2023
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Sep 18, 2023
jeremiedbb added a commit that referenced this pull request Sep 20, 2023
)

Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
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