Skip to content

[MRG] Fix NCA parameter type check #14092

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 5 commits into from
Jun 18, 2019

Conversation

jeremiedbb
Copy link
Member

@jeremiedbb jeremiedbb commented Jun 14, 2019

Fixes #14033

type check of parameters in NCA are too strict. Typically when params are part of a grid built with numpy (linspace, arange, ...) for a grid search, the types are numpy integer or floating types.

@@ -129,7 +129,7 @@ def test_params_validation():
# TypeError
assert_raises(TypeError, NCA(max_iter='21').fit, X, y)
assert_raises(TypeError, NCA(verbose='true').fit, X, y)
assert_raises(TypeError, NCA(tol=1).fit, X, y)
assert_raises(TypeError, NCA(tol='1').fit, X, y)
Copy link
Member Author

Choose a reason for hiding this comment

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

integers are part of numbers.Real. But afaik there's not type for 'any float type but not int type'.
However, I don't see why setting tol=1 would be bad.

@jnothman jnothman added this to the 0.21.3 milestone Jun 18, 2019
@jnothman
Copy link
Member

Thanks @jeremiedbb!

@jnothman jnothman merged commit 197f448 into scikit-learn:master Jun 18, 2019
@jnothman
Copy link
Member

Whoops. Forgot what's new. Please add to 0.21.3 and open a new PR.

jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Jun 24, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NCA fails in GridSearch due to too strict parameter checks
3 participants