[MRG] Simplify test commons #3439

Merged
merged 3 commits into from Jul 19, 2014

4 participants

@arjoly
scikit-learn member

Ping @amueller, @kylekatsner

@arjoly
scikit-learn member

negative line count :-)

@amueller
scikit-learn member

awesome +1

@coveralls

Coverage Status

Coverage increased (+0.0%) when pulling f7b94f6 on arjoly:test-commons into e23d9c9 on scikit-learn:master.

@kastnerkyle kastnerkyle and 2 others commented on an outdated diff Jul 19, 2014
sklearn/utils/estimator_checks.py
@@ -52,6 +54,40 @@ def _boston_subset(n_samples=200):
BOSTON = X, y
return BOSTON
+def set_fast_parameters(estimator):
+ # speed up some estimators
+ params = estimator.get_params()
+ if "n_iter" in params:
+ estimator.set_params(n_iter=5)
+ if "max_iter" in params:
+ # NMF
+ if estimator.max_iter is not None:
+ estimator.set_params(max_iter=min(5, estimator.max_iter))
+ if "n_resampling" in params:
+ #randomized lasso
@kastnerkyle
scikit-learn member
kastnerkyle added a line comment Jul 19, 2014

space after # ?

@arjoly
scikit-learn member
arjoly added a line comment Jul 19, 2014

not mine :p

@amueller
scikit-learn member
amueller added a line comment Jul 19, 2014

cough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@kastnerkyle
scikit-learn member

I put a nitpick but 👍 either way :)

@arjoly
scikit-learn member

Fix pep8 issues

@arjoly arjoly closed this Jul 19, 2014
@arjoly arjoly reopened this Jul 19, 2014
@arjoly arjoly merged commit 46613e2 into scikit-learn:master Jul 19, 2014

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
@arjoly arjoly deleted the arjoly:test-commons branch Jul 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment