[MRG] ENH allow to specify which methods should run a check in CheckingClassifier#15230
Conversation
thomasjpfan
left a comment
There was a problem hiding this comment.
Thank you @BenjaminBossan for the PR!
* parametrize tests where possible * add test for classes_ attribute * use pytest.approx for float comparison
|
@thomasjpfan Thanks for the helpful comments. I changed the code to reflect your suggestions. A few things I did differently, mainly to have each test only check one specific functionality. |
jnothman
left a comment
There was a problem hiding this comment.
Sorry I've only glanced at this
jnothman
left a comment
There was a problem hiding this comment.
Actually this now has substantial conflicts with #17259. Sorry @BenjaminBossan... @glemaitre, does this PR still have something to offer?
|
First sorry to have rush without seeing this PR. I think that there are a couple of tests that should be added because they are making covering a use case that I did not add in the other PR. I am going to solve the conflict and keep the required tests. |
|
OK, I clean-up my mess from master. This would be what I would keep. |
|
It seems that some tests are failing, are you taking a look at them @glemaitre? I could also do it but not earlier than the weekend. |
|
@jnothman I added a parameter to be able to make the check specific to a specific method if needed (which was the case). |
| ) | ||
|
|
||
| clf.fit(X, y) | ||
| if predict_method in methods_to_check: |
There was a problem hiding this comment.
@glemaitre It's always fun reading how you parametrize things.
|
Thanks @BenjaminBossan. Sorry for the bumps on the road but it was worth. |
|
Thank you @glemaitre for finishing this. |
…sifier (scikit-learn#15230) Co-authored-by: BenjaminBossan <b.bossan@gmail.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
…sifier (scikit-learn#15230) Co-authored-by: BenjaminBossan <b.bossan@gmail.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
Adding tests as discussed in #15218.
What does this implement/fix? Explain your changes.
Add unit tests for
CheckingClassifier, improve its docstring.Any other comments?
I would propose renaming the
foo_paramargument to something moreuseful, e.g.
score_paramsince it affects thescoremethod. SinceCheckingClassifieris located in_mocking.py, such a change shouldnot break the public API.