Skip to content

MAINT validate parameter in VarianceThreshold#23581

Merged
glemaitre merged 7 commits intoscikit-learn:mainfrom
SangamSwadiK:validate_variance_threshold
Jun 24, 2022
Merged

MAINT validate parameter in VarianceThreshold#23581
glemaitre merged 7 commits intoscikit-learn:mainfrom
SangamSwadiK:validate_variance_threshold

Conversation

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