Skip to content

API Rename base_estimator in CalibratedClassifierCV #22054

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
merged 12 commits into from
May 30, 2022

Conversation

kevroi
Copy link
Contributor

@kevroi kevroi commented Dec 22, 2021

Reference Issues/PRs

partly addresses #9104

What does this implement/fix? Explain your changes.

Renames base_estimator to estimators for the CalibratedClassifierCV by
renaming in the CalibratedClassifierCV and __CalibratedClassifier classes

@kevroi kevroi changed the title Renaming base_estimator #9104 Renaming base_estimator Dec 22, 2021
@glemaitre glemaitre changed the title Renaming base_estimator MAINT rename base_estimator to estimator in CalibratedClassifierCV Dec 22, 2021
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

We should as well in the calibration.rst and example that we don't have any occurrence of base_estimator there.

@thomasjpfan
Copy link
Member

thomasjpfan commented Apr 24, 2022

Hello @kevroi, are you still interested in working on PR? If so, there are review comments to be addressed from #22054 (review)

@glemaitre glemaitre self-assigned this May 19, 2022
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM.
@thomasjpfan do you want to have a quick pass.

@glemaitre glemaitre removed their assignment May 19, 2022
@glemaitre glemaitre added the Quick Review For PRs that are quick to review label May 19, 2022
@glemaitre glemaitre self-assigned this May 19, 2022
"will be removed in 1.4.",
FutureWarning,
)
self.estimator = self.base_estimator
Copy link
Member

Choose a reason for hiding this comment

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

This is usually an anti-pattern in scikit-learn. In this case, I think we we can get away with:

if self.base_estimator != "deprecated":
    ...
    estimator = self.base_estimator
else:
    estimator = self.estimator

# Estimator from now on
if estimator is None:
    estimator = LinearSVC(random_state=0)

if self.cv == "prefit":
    check_is_fitted(estimator, ...)

WDYT @glemaitre ?

Copy link
Member

Choose a reason for hiding this comment

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

I see what you mean. I think that you are right. Let me update it.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

LGTM

@thomasjpfan thomasjpfan changed the title MAINT rename base_estimator to estimator in CalibratedClassifierCV API Rename base_estimator in CalibratedClassifierCV May 30, 2022
@thomasjpfan thomasjpfan merged commit effdd6e into scikit-learn:main May 30, 2022
ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
Co-authored-by: Kevin Roice <kevinroice@Kevins-Air.broadband>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Quick Review For PRs that are quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants