Skip to content

[MRG+1] Common test refactoring#4550

Merged
ogrisel merged 5 commits intoscikit-learn:masterfrom
amueller:common_test_refactoring
Apr 30, 2015
Merged

[MRG+1] Common test refactoring#4550
ogrisel merged 5 commits intoscikit-learn:masterfrom
amueller:common_test_refactoring

Conversation

@amueller
Copy link
Copy Markdown
Member

@amueller amueller commented Apr 8, 2015

Fixes #3810.

Introduces a public check_estimator that runs all checks.
Currently it relies on inheritance to see which tests to run (in addition to the general tests).
It could also rely on the recently introduced tags #4418 but there is currently only a single tag, while something might be a classifier and a transformer....

Todo:

  • tests for high-level interface function.
  • make sure all tests are run as they were before
  • add to docs

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.95%) to 94.2% when pulling 6211e07 on amueller:common_test_refactoring into 46aacd3 on scikit-learn:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 95.17% when pulling 6211e07 on amueller:common_test_refactoring into 46aacd3 on scikit-learn:master.

@amueller amueller added this to the 1.0 milestone Apr 8, 2015
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is absorbed into the tests above

@amueller amueller force-pushed the common_test_refactoring branch from a13715a to c4f2488 Compare April 8, 2015 19:44
@amueller amueller changed the title WIP Common test refactoring [MRG] Common test refactoring Apr 8, 2015
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is ugly, and we could probably change that by raising an error. The orginal traceback is printed anyhow. @GaelVaroquaux thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shall it be done in this PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

that is old, don't feel like doing it now ;)

@agramfort
Copy link
Copy Markdown
Member

sent you a PR with nitpicks.

besides LGTM !

@amueller amueller force-pushed the common_test_refactoring branch from ce5713f to ac56fbf Compare April 19, 2015 18:29
@agramfort
Copy link
Copy Markdown
Member

travis is not happy :(

@amueller
Copy link
Copy Markdown
Member Author

I need to rebase on #4590 to get consistent behavior for python2 and python3.

@amueller amueller force-pushed the common_test_refactoring branch from e386698 to 196a7b7 Compare April 28, 2015 20:46
@amueller
Copy link
Copy Markdown
Member Author

that should do it. that was some annoying testing....

@amueller
Copy link
Copy Markdown
Member Author

meta

@agramfort agramfort changed the title [MRG] Common test refactoring [MRG+1] Common test refactoring Apr 29, 2015
@agramfort
Copy link
Copy Markdown
Member

+1 for merge. thx @amueller !

@amueller
Copy link
Copy Markdown
Member Author

thanks @agramfort for the review :)

@ogrisel
Copy link
Copy Markdown
Member

ogrisel commented Apr 30, 2015

This looks good to me. We can always improve further but I would rather not delay this refactoring that is already a net benefit.

ogrisel added a commit that referenced this pull request Apr 30, 2015
@ogrisel ogrisel merged commit b92ed8f into scikit-learn:master Apr 30, 2015
@arjoly
Copy link
Copy Markdown
Member

arjoly commented Apr 30, 2015

Thanks @amueller !!!

@mblondel
Copy link
Copy Markdown
Member

Great, I will try check_estimator on lightning when I get time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not using is_classifier? (which is based on estimator tags rather than inheritance)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I commented somewhere: you can inherit from multiple mixins, but only have one tag currently. Maybe that is an issue with the tag system?
I could have used the tags for everything but Transformer, maybe I should have done that. I kind of punted on this one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For detecting transformers, I think checking for fit_transform or transform should be pretty reliable. Not sure if we need to add a new is_transformer helper, though.

@amueller
Copy link
Copy Markdown
Member Author

@mblondel yeah it would be sweet if you could try it. And I'm sure it will fail ;)

@amueller amueller deleted the common_test_refactoring branch April 30, 2015 13:42
@amueller
Copy link
Copy Markdown
Member Author

@ogrisel any improvment you have in mind / anything that is missing? thanks for the merge :)

@mblondel
Copy link
Copy Markdown
Member

@amueller And lightning is probably far from compliant, especially w.r.t. to input checking.

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.

Estimator verification API

6 participants