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

[MRG] FIX ignore null weight when computing estimator error in AdaBoostRegressor #14294

Merged
merged 30 commits into from Oct 25, 2019

Conversation

glemaitre
Copy link
Contributor

@glemaitre glemaitre commented Jul 8, 2019

AdaBoostRegressor suffers from a bug where the error was normalized using the max of the absolute error on all prediction even if they were corresponding to a null-weight in sample_weigth

@rth
Copy link
Member

@rth rth commented Jul 8, 2019

BTW, this seems related to #14286 which investigates a similar issue with SVM.

@glemaitre glemaitre changed the title FIX ignore null weight when computing estimator error in AdaBoostRegressor [MRG] FIX ignore null weight when computing estimator error in AdaBoostRegressor Jul 8, 2019
@glemaitre glemaitre force-pushed the is/fix_adaboost_regressor branch from ede568e to 6902eff Compare Sep 10, 2019
@glemaitre
Copy link
Contributor Author

@glemaitre glemaitre commented Sep 10, 2019

ping @rth @jeremiedbb I think that you are the best to review this bug fix.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Not using points with zero weight to compute the error seems fair.

Below are some comments.

sklearn/ensemble/weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
@glemaitre glemaitre added this to TO DO in Guillaume's pet Sep 10, 2019
@glemaitre glemaitre force-pushed the is/fix_adaboost_regressor branch from 2f27d59 to 810c637 Compare Sep 12, 2019
@glemaitre glemaitre moved this from TO DO to WAITING FOR REVIEW in Guillaume's pet Sep 12, 2019
Copy link
Member

@jeremiedbb jeremiedbb left a comment

besides minor comments, LGTM.

doc/whats_new/v0.22.rst Outdated Show resolved Hide resolved
doc/whats_new/v0.22.rst Outdated Show resolved Hide resolved
sklearn/ensemble/weight_boosting.py Outdated Show resolved Hide resolved
@glemaitre glemaitre moved this from WAITING FOR REVIEW to TO DO in Guillaume's pet Sep 12, 2019
glemaitre and others added 2 commits Sep 12, 2019
Co-Authored-By: jeremiedbb <34657725+jeremiedbb@users.noreply.github.com>
@glemaitre glemaitre moved this from TO DO to WAITING FOR REVIEW in Guillaume's pet Sep 12, 2019
@glemaitre
Copy link
Contributor Author

@glemaitre glemaitre commented Sep 24, 2019

@adrinjalali I'm pinging you aggressively ;)

Copy link
Member

@adrinjalali adrinjalali left a comment

I need to double check a few things before I can be sure about its correctness and completeness. But I was wondering if it'd be easier to mask the samples and the sample weight right at the beginning of the fit, and continue with all of what's left.

P.S. thanks for the very aggressive ping :P

sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
sklearn/ensemble/tests/test_weight_boosting.py Outdated Show resolved Hide resolved
@glemaitre
Copy link
Contributor Author

@glemaitre glemaitre commented Oct 3, 2019

I was wondering if it'd be easier to mask the samples and the sample weight right at the beginning of the fit, and continue with all of what's left.

Nop because the bootstrapping will lead to different results since the input data will be different due to masking.

@glemaitre
Copy link
Contributor Author

@glemaitre glemaitre commented Oct 22, 2019

@adrinjalali Any other comments?

Copy link
Member

@adrinjalali adrinjalali left a comment

Other than the small nit, LGTM, thanks @glemaitre

sklearn/utils/_mocking.py Outdated Show resolved Hide resolved
@glemaitre
Copy link
Contributor Author

@glemaitre glemaitre commented Oct 25, 2019

Ready to be merged @adrinjalali @jeremiedbb

@adrinjalali adrinjalali merged commit 1888a96 into scikit-learn:master Oct 25, 2019
19 checks passed
@adrinjalali
Copy link
Member

@adrinjalali adrinjalali commented Oct 25, 2019

Thanks @glemaitre :)

@glemaitre glemaitre moved this from WAITING FOR REVIEW to REVIEWED AND WAITING FOR CHANGES in Guillaume's pet Oct 25, 2019
@glemaitre glemaitre moved this from REVIEWED AND WAITING FOR CHANGES to MERGED in Guillaume's pet Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants