8000 Bug in common tests: should use utils.testing._get_args · Issue #9350 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Bug in common tests: should use utils.testing._get_args #9350

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 13, 2017 · 3 comments · Fixed by #11277
Closed

Bug in common tests: should use utils.testing._get_args #9350

amueller opened this issue Jul 13, 2017 · 3 comments · Fixed by #11277

Comments

@amueller
Copy link
Member

Right now we are using inspect in some common tests (utils.estimator_checks) to get method arguments. But that doesn't work if the method is decorated, for example with a deprecation.

In that case we need to use utils.testing._get_args. So we need to make sure to use that whenever we inspect arguments.
A good test would be to create a model that has all methods deprecated and see if the tests still pass.
We should also check whether the sample_weights are detected correctly.

@tsdlovell
Copy link
Contributor

Is this still an open issue? I don't see any usages of inspect in utils.estimator_checks

git grep inspect -- utils/estimator_checks.py | wc -l
0

@markroth8
Copy link
Contributor

@tsdlovell - After looking at the code a bit, it's possible inspect (or something like it) is being used indirectly.

I'm working on this. My first step is to confirm the issue still exists by writing a test.

@markroth8
Copy link
Contributor

Discussed this with @amueller and we agreed the most direct approach to confirming this issue is to create a unit test for has_fit_parameter in validation.py which checks that it returns True if the parameter is present, even if the fit method is marked as deprecated.

If False, the bug is confirmed. If True, the bug is already fixed but we can still commit the test.

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