Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT rename base_estimator to estimator in RANSACRegressor - #22062

Merged
jjerphan merged 8 commits into
scikit-learn:mainfrom
trujillo9616:estimator_renaming
Jan 6, 2022
Merged

MAINT rename base_estimator to estimator in RANSACRegressor#22062
jjerphan merged 8 commits into
scikit-learn:mainfrom
trujillo9616:estimator_renaming

Conversation

@trujillo9616

Copy link
Copy Markdown
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

cmarmo commented Dec 23, 2021

Copy link
Copy Markdown
Contributor

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.

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

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

Parameters
----------
base_estimator : object, default=None
estimator : object, default=None

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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! 😁

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

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.

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

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.

Comment thread doc/whats_new/v1.1.rst Outdated
- |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
Copy Markdown
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
Copy Markdown
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

cmarmo commented Jan 5, 2022

Copy link
Copy Markdown
Contributor

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

cmarmo commented Jan 5, 2022

Copy link
Copy Markdown
Contributor

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