8000 AdaBoost: allow base_estimator=None by markotoplak · Pull Request #26242 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

AdaBoost: allow base_estimator=None #26242

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

Conversation

markotoplak
Copy link
Contributor

Reference Issues/PRs

Fixes #26241.

What does this implement/fix? Explain your changes.

To ensure that the (deprecated) explicit base_estimator=None doesn't stop working, add a (likely forgotten) None to a list allowed values in _parameter_constraints. Everything else already seems to be setup properly.

@adrinjalali
Copy link
Member

This would need also a test, and an item in the changelog.

@markotoplak markotoplak force-pushed the fix-adaboost-base_estimator-deprecation branch 2 times, most recently from d42c7ef to c999b14 Compare May 8, 2023 11:17
@markotoplak markotoplak force-pushed the fix-adaboost-base_estimator-deprecation branch from c999b14 to f9c4ce3 Compare May 8, 2023 12:58
@markotoplak markotoplak changed the title AdaBoost: allow base_estimator=None. AdaBoost: allow base_estimator=None May 8, 2023
@markotoplak
Copy link
Contributor Author

@adrinjalali, thanks for the review.

I added a test and modified _validate_estimator accordingly: now the deprecation message is also shown at base_estimator=None, as it is my opinion should, because this setting is explicit (the default is "deprecated", so there are no conflicts).

Also, there still remains a small bug in _validate_estimator: user code where estimator is not None and base_estimator is None is now allowed, but should not be (base_estimator=None is always an explicit setting). But fixing it could create problems, because it could raise an exception for code that is currently valid. On the other hand such code will crash after 1.4 anyway when the deprecated parameter is be removed. I opted not to change that part for now, but can easily add a commit that does.

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.

Thanks, this LGTM.

On the other hand such code will crash after 1.4 anyway when the deprecated parameter is be removed. I opted not to change that part for now, but can easily add a commit that does.

Yeah, we can just leave it alone, it'll fix itself when we remove support for base_estimator

Copy link
Member
@betatim betatim left a comment

Choose a reason for hiding this comment

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

LGTM modulo those trailing underscores.

@adrinjalali
Copy link
Member

LGTM modulo those trailing underscores.

@betatim which trailing underscores?

@markotoplak
Copy link
Contributor Author

Trailing underscores in the changelog were removed in the last commit. Sorry.

@betatim betatim merged commit 72a6049 into scikit-learn:main May 10, 2023
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.

AdaBoost: deprecation of "base_estimator" does not handle "base_estimator=None" setting properly
3 participants
0