Skip to content
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

sklearn/utils/tests/test_pprint.py is too brittle to API changes #13508

Closed
jnothman opened this issue Mar 25, 2019 · 5 comments
Closed

sklearn/utils/tests/test_pprint.py is too brittle to API changes #13508

jnothman opened this issue Mar 25, 2019 · 5 comments
Labels
Easy Well-defined and straightforward way to resolve help wanted

Comments

@jnothman
Copy link
Member

Although I was fine making this test file depend on the definitions of various estimators, #13470 has made it clear that this can be a nuisance to developers when they add a parameter to the estimators that happen to be used in those tests (or even change a default value). I think if we replace:

from sklearn.linear_model import LogisticRegression

with something like

# Some example constructors excerpted to test pprinting

class LogisticRegression(BaseEstimator):
    """Logistic Regression (aka logit, MaxEnt) classifier.
    """

    def __init__(self, penalty='l2', dual=False, tol=1e-4, C=1.0,
                 fit_intercept=True, intercept_scaling=1, class_weight=None,
                 random_state=None, solver='warn', max_iter=100,
                 multi_class='warn', verbose=0, warm_start=False, n_jobs=None,
                 l1_ratio=None):
        pass

and do similar for other classes, then we will get most of the effect of the tests (checking that standard use cases look acceptable) without being brittle to changes in parameters of those estimators.

@jnothman jnothman added Easy Well-defined and straightforward way to resolve help wanted labels Mar 25, 2019
@jnothman
Copy link
Member Author

Ping @NicolasHug, @hermidalc

@NicolasHug
Copy link
Member

Feel free to give it a shot @hermidalc (or anyone else).

Else I'll do it

@scouvreur
Copy link
Contributor

Could I give this issue a try @NicolasHug @jnothman if no-one else is working on it ?

@NicolasHug
Copy link
Member

Sure go ahead, thanks!

@NicolasHug
Copy link
Member

Closing since it was addressed in #13529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Well-defined and straightforward way to resolve help wanted
Projects
None yet
Development

No branches or pull requests

3 participants