Skip to content

API Deprecates copy_X in TheilSenRegressor #29105

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, 2024
Merged

Conversation

adam2392
Copy link
Member

Reference Issues/PRs

Fixes: #29098

What does this implement/fix? Explain your changes.

Deprecates the copy_X parameter as it is not used.

Any other comments?

I'm unsure of two things:

  1. should a unit-test be added for such a trivial deprecation?
  2. is this the proper way to deprecate a boolean argument within scikit-learn?

Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Copy link

github-actions bot commented May 25, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 9801d47. Link to the linter CI: here

Copy link
Contributor

@Charlie-XIAO Charlie-XIAO left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @adam2392. I left some comments, and I believe you also need to:

  • Change the default value of copy_X to "deprecated".
  • In the fit method, raise in the very beginning a FutureWarning if copy_X != "deprecated" with a comprehensive message. You may refer to other deprecation warnings.
  • And yes I think you need to add a test. Normally the deprecated parameter will be explicitly set in some tests and then one can assert deprecation warnings for those tests. In this case I think copy_X is simply not tested anywhere, so you may want to add one yourself.

This part of the developers' docs might also be helpful.

Signed-off-by: Adam Li <adam2392@gmail.com>
@adam2392
Copy link
Member Author

Ah nice! Thanks for pointing out that part of the documentation. Haven't seen it before.

The last commit 7d23696 should address your comments. Thanks for the quick review!

Copy link
Contributor

@Charlie-XIAO Charlie-XIAO left a comment

Choose a reason for hiding this comment

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

Thanks for the quick update @adam2392! Just some nitpicks and minor mistakes left, otherwise LGTM:

adam2392 added 2 commits May 28, 2024 10:18
-s

Signed-off-by: Adam Li <adam2392@gmail.com>
@adam2392 adam2392 requested a review from Charlie-XIAO May 28, 2024 16:12
Copy link
Contributor

@Charlie-XIAO Charlie-XIAO left a comment

Choose a reason for hiding this comment

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

Sorry @adam2392 for repeatedly asking for changes. It seems that I've got some pending comments that weren't successfully sent out in the previous review. They are very minor so I'm approving in advance. Thanks for the contribution!

adam2392 and others added 2 commits May 28, 2024 12:23
Co-authored-by: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com>
Co-authored-by: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com>
@Charlie-XIAO Charlie-XIAO added the Quick Review For PRs that are quick to review label May 28, 2024
Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @adam2392

adam2392 and others added 2 commits May 29, 2024 09:37
Co-authored-by: Omar Salman <omar.salman@arbisoft.com>
Co-authored-by: Omar Salman <omar.salman@arbisoft.com>
@adam2392 adam2392 requested a review from OmarManzoor May 29, 2024 16:29
Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @adam2392

@OmarManzoor OmarManzoor merged commit f316f4c into scikit-learn:main May 30, 2024
30 checks passed
@jeremiedbb jeremiedbb mentioned this pull request Jul 2, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:linear_model Quick Review For PRs that are quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate copy_X in TheilSenRegressor
3 participants