Skip to content

API Deprecates copy_X in TheilSenRegressor#29105

Merged
OmarManzoor merged 12 commits intoscikit-learn:mainfrom
adam2392:dep2
May 30, 2024
Merged

API Deprecates copy_X in TheilSenRegressor#29105
OmarManzoor merged 12 commits intoscikit-learn:mainfrom
adam2392:dep2

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 <[email protected]>
Signed-off-by: Adam Li <[email protected]>
@github-actions
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.

@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 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!

@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 <[email protected]>
Co-authored-by: Omar Salman <[email protected]>
@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

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