Skip to content

MAINT rename base_estimator to estimator in RANSACRegressor #22062

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 8 commits into from
Jan 6, 2022

Conversation

trujillo9616
Copy link
Contributor

Reference Issues/PRs

See #9104. This PR enhances some of the proposed changes in the referenced issue.

What does this implement/fix? Explain your changes.

For RANSACRegressor:
This enhancement renames the base_estimator parameter to estimator in the RANSACRegressor class for improved readability and consistency.

For test_ransac.py:
Tests in the test_ransac.py. file were modified for using the updated parameter. A test case was added to check if the warning has been raised when setting the base_estimator parameter.

@trujillo9616 trujillo9616 changed the title MAINT RANSACRegressor estimator renaming MAINT rename base_estimator to estimator in RANSACRegressor Dec 22, 2021
@cmarmo
Copy link
Contributor

cmarmo commented Dec 23, 2021

Thanks @trujillo9616 for your pull request.
Some test are still failing... perhaps some base_estimator still need to be renamed in the tests?
Also you can add a changelog for this contribution just like in #19908.

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.

Otherwise, it looks good. I did not check yet the reason for the CI to fail.

Please add an entry to the change log at doc/whats_new/v1.1.rst. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:.

@@ -65,7 +65,7 @@ class RANSACRegressor(

Parameters
----------
base_estimator : object, default=None
estimator : object, default=None
Copy link
Member

Choose a reason for hiding this comment

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

we still need the base_estimator docstring

base_estimator : object, default="deprecated"
    Use `estimator` instead.

    .. deprecated:: 1.1
        `base_estimator` is deprecated and will be removed in 1.3.
        Use `estimator` instead.

@glemaitre
Copy link
Member

So the CI is failing because you did not document base_estimator as I suggested. So once done, this PR should turn green (adding as well the what's new).

@trujillo9616
Copy link
Contributor Author

@cmarmo @glemaitre Thank you for your feedback and code review! I've updated the docstring in the RANSACRegressor class and the doc/whats_new/v1.1.rst change log. Hopefully now everything's in order, if anything needs to be further improved please let me know! 😁

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 on my side. We will need a second review.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM once the changelog order is fixed.

- |Enhancement| Rename parameter `base_estimator` to `estimator` in
:class:`linear_model.RANSACRegressor` to improve readability and consistency.
`base_estimator` is deprecated and will be removed in 1.3.
:pr:`22062` by :user:`Adrian Trujillo <trujillo9616>`.
Copy link
Member

Choose a reason for hiding this comment

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

Please group the |Enhancement| entries together, before the |Fix| entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, l'll update the changelog in a bit. Thanks for the review!

@cmarmo
Copy link
Contributor

cmarmo commented Jan 5, 2022

Hello @trujillo9616 , thank you for your work. Some conflicts arose. Do you mind fixing them in synchronizing with main? You might want to have a look to the github documentation for that.

@trujillo9616
Copy link
Contributor Author

@cmarmo I resolved the conflicts, thanks for the guidance! All the tests have passed now 🥳 , I'll be on the lookout in case you suggest further modifications.

@cmarmo
Copy link
Contributor

cmarmo commented Jan 5, 2022

Thanks @trujillo9616, all green again... now we just wait for someone pressing the merge button! :)

@jjerphan jjerphan merged commit 1c24595 into scikit-learn:main Jan 6, 2022
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.

5 participants