question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NicolasHugcommented, Mar 25, 2019

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

Else I’ll do it

0reactions
NicolasHugcommented, Jun 1, 2019

Closing since it was addressed in #13529

Read more comments on GitHub >

github_iconTop Results From Across the Web

jamalex/notion-py: Unofficial Python API client for ... - GitHub
Unofficial Python 3 client for Notion.so API v3. Object-oriented interface (mapping database tables to Python classes/attributes); Automatic conversion between ...
Read more >
Python & APIs: A Winning Combo for Reading Public Data
In this tutorial, you'll learn what APIs are and how to consume them using Python. You'll also learn some core concepts for working...
Read more >
APIs for Beginners - How to use an API (Full Course / Tutorial)
APIs are used all the time in programming and web development so it ... Libraries ( Python ) (1:24:40) ⭐️ Unit 3 -...
Read more >
API changes (Watson Machine Learning) - IBM
Managing API changes using a version date. Watson Machine Learning REST API now includes a VersionDate parameter that you can use to associate...
Read more >
Binance Python API – A Step-by-Step Guide - Algo Trading 101
Commissions are very competitive and you may be hard-pressed to find ... Another challenge with API trading at Binance is that API changes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found