8000 [MRG] Removes input validation radiusneighborsclassifier by chritter · Pull Request #21518 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] Removes input validation radiusneighborsclassifier #21518

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

chritter
Copy link
Contributor

Reference Issues/PRs

Addresses #21406

What does this implement/fix? Explain your changes.

Remove input validation for RadiusNeighborsClassifier set_params.

Any other comments?

Work with @fortune-uwha
#DataUmbrella

@chritter
Copy link
Contributor Author

@thomasjpfan Hi Thomas, we found that set_params does not pass the input validation test due to the inheritance from sklearn/base.py:BaseEstimator.set_params() which performs input validation. Could you clarify if this input validation test is appropriate? cc @fortune-uwha

@ogrisel
Copy link
Member
ogrisel commented Nov 4, 2021

I pushed a merge of the current main branch to benefit from improved error messages in set_params. Don't forget to pull this commit into your local branch (#21542).

Copy link
Member
@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @chritter !

We need to adjust the test to skip **kwargs in RadiusNeighborsClassifier:

def test_estimators_do_not_raise_errors_in_init_or_set_params(Estimator):
    # Remove parameters with **kwargs by filtering out Parameter.VAR_KEYWORD
    # TODO: Remove in 1.2 when **kwargs is removed in RadiusNeighborsClassifier
    params = [
        name
        for name, param in signature(Estimator).parameters.items()
        if param.kind != Parameter.VAR_KEYWORD
    ]
    ...

…nto removes_validation_radiusneighborsclassifier
@chritter
Copy link
Contributor Author
chritter commented Nov 5, 2021
Parameter.VAR_KEYWORD

Thank you for sharing this solution. Learned again something new :) I will implement it into the test.

@chritter chritter changed the title [WIP] Removes input validation radiusneighborsclassifier [MRG] Removes input validation radiusneighborsclassifier Nov 5, 2021
@reshamas reshamas added the Sprint label Nov 5, 2021
Copy link
Member
@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the update @chritter!

LGTM

For reviewers: I added the "No Changelog Required" label because there is no functional change to RadiusNeighborsClassifier.

@ogrisel ogrisel merged commit a2ca3ae into scikit-learn:main Nov 5, 2021
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Nov 29, 2021
…n#21518)



Co-authored-by: Fortune Uwha <fortune.uwha@gmail.com>
Co-authored-by:  Thomas J. Fan <thomasjpfan@gmail.com>
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
…n#21518)



Co-authored-by: Fortune Uwha <fortune.uwha@gmail.com>
Co-authored-by:  Thomas J. Fan <thomasjpfan@gmail.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.

4 participants
0