Skip to content

all the neighbors algorithms to parameter validation in __init__ #9378

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

Closed
amueller opened this issue Jul 16, 2017 · 0 comments · Fixed by #9450
Closed

all the neighbors algorithms to parameter validation in __init__ #9378

amueller opened this issue Jul 16, 2017 · 0 comments · Fixed by #9450

Comments

@amueller
Copy link
Member

amueller commented Jul 16, 2017

there's the _init_params method in NeighborsBase and it looks like this is called in __init__.
It looks like this is not called in fit again, so these checks are not done after set_params.
There's also private attributes set in __init__ which makes me think that this could lead to subtle bugs with clone.

(it doesn't set any public attributes, though, and the private attributes are all None)

I think we should not set any attributes in init apart from the init parameters, and we should make check_no_fit_attributes_set_in_init much stricter, to check that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants