Skip to content

[WIP] MAINT Parameters validation for sklearn.neighbors.KNeighborsTransformer #26451

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

Conversation

StefanieSenger
Copy link
Contributor

Reference Issues/PRs

#24862

What does this implement/fix? Explain your changes.

  • added the validate_params decorator to sklearn.neighbors.KNeighborsTransformer

@StefanieSenger StefanieSenger changed the title MAINT Parameters validation for sklearn.neighbors.KNeighborsTransformer [WIP] MAINT Parameters validation for sklearn.neighbors.KNeighborsTransformer May 28, 2023
@@ -342,12 +365,6 @@ class KNeighborsTransformer(
(178, 178)
"""

_parameter_constraints: dict = {
Copy link
Member

Choose a reason for hiding this comment

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

for classes, parameter validation for the constructor arguments is done via _parameter_constraints class attribute as you see here, and not via the @validate_params decorator.

And as you can see, it is implemented already for this class, so nothing left to be done for KNeighborsTransformer.

@validate_params is used for functions, and we're adding them to most public functions, for example, this one: #26086. Therefore this PR can be closed.

@StefanieSenger StefanieSenger deleted the validate_params_KNeighborsTransformer branch June 1, 2023 09:22
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.

2 participants