Skip to content

MAINT validate parameter in VarianceThreshold #23581

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 7 commits into from
Jun 24, 2022

Conversation

SangamSwadiK
Copy link
Contributor

Reference Issues/PRs

Issue: #23462 validating estimator params

What does this implement/fix? Explain your changes.

  • Validation of parameters for the Variance Threshold.
  • fit calls _validate_parameters as first step to validate it.

Any other comments?

Please let me know if I missed something/did it incorrectly, ill fix it asap.

SangamSwadiK and others added 3 commits June 10, 2022 17:15
Remove variance threshold from to be validated
Add parameter validation for variance threshold.
Copy link
Member

@jeremiedbb jeremiedbb 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 @SangamSwadiK. You can now remove the validation on line 118 elif self.threshold < 0.0:, and the corresponding test test_variance_negative in test_variance_threshold.py

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM

@SangamSwadiK SangamSwadiK changed the title Validate variance threshold [MRG]Validate variance threshold Jun 24, 2022
@glemaitre glemaitre changed the title [MRG]Validate variance threshold MAINT validate parameter in VarianceThreshold Jun 24, 2022
@glemaitre glemaitre merged commit b60832d into scikit-learn:main Jun 24, 2022
@glemaitre
Copy link
Member

All good. Merging. Thanks @SangamSwadiK

ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
Co-authored-by: Sangam Swadi K <sangamswadik@users.noreply.github.com>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
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.

3 participants