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

This comment has been minimized.

Copy link
Member

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 glemaitre:is/fix_adaboost_regressor branch from ede568e to 6902eff Sep 10, 2019
@glemaitre

This comment has been minimized.

Copy link
Contributor Author

glemaitre commented Sep 10, 2019

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

Copy link
Member

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 glemaitre:is/fix_adaboost_regressor branch from 2f27d59 to 810c637 Sep 12, 2019
glemaitre added 2 commits 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 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 added 2 commits Sep 13, 2019
@glemaitre

This comment has been minimized.

Copy link
Contributor Author

glemaitre commented Sep 24, 2019

@adrinjalali I'm pinging you aggressively ;)

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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 added 5 commits Oct 3, 2019
…to is/fix_adaboost_regressor
fix
@glemaitre

This comment has been minimized.

Copy link
Contributor Author

glemaitre commented Oct 22, 2019

@adrinjalali Any other comments?

Copy link
Member

adrinjalali left a comment

Other than the small nit, LGTM, thanks @glemaitre

sklearn/utils/_mocking.py Outdated Show resolved Hide resolved
@glemaitre

This comment has been minimized.

Copy link
Contributor Author

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
19 checks passed
LGTM analysis: C/C++ No code changes detected
Details
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No new or fixed alerts
Details
ci/circleci: deploy Your tests passed on CircleCI!
Details
ci/circleci: doc Your tests passed on CircleCI!
Details
ci/circleci: doc artifact Link to 0/doc/_changed.html
Details
ci/circleci: doc-min-dependencies Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 97.21%)
Details
codecov/project 97.22% (+<.01%) compared to 0a7adef
Details
scikit-learn.scikit-learn Build #20191023.30 succeeded
Details
scikit-learn.scikit-learn (Linux py35_conda_openblas) Linux py35_conda_openblas succeeded
Details
scikit-learn.scikit-learn (Linux py35_ubuntu_atlas) Linux py35_ubuntu_atlas succeeded
Details
scikit-learn.scikit-learn (Linux pylatest_conda_mkl) Linux pylatest_conda_mkl succeeded
Details
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas) Linux pylatest_pip_openblas_pandas succeeded
Details
scikit-learn.scikit-learn (Linux32 py35_ubuntu_atlas_32bit) Linux32 py35_ubuntu_atlas_32bit succeeded
Details
scikit-learn.scikit-learn (Windows py35_pip_openblas_32bit) Windows py35_pip_openblas_32bit succeeded
Details
scikit-learn.scikit-learn (Windows py37_conda_mkl) Windows py37_conda_mkl succeeded
Details
scikit-learn.scikit-learn (macOS pylatest_conda_mkl) macOS pylatest_conda_mkl succeeded
Details
@adrinjalali

This comment has been minimized.

Copy link
Member

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
4 participants
You can’t perform that action at this time.