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.

MyDummyClassifer/MyDummyRegressor fails when printed

See original GitHub issue

Describe the bug

When all the pipelines failed due to any reason, MyDummyClassifier is selected as best model. When using show_models api, execution fails.

To Reproduce

import sklearn.datasets
import sklearn.metrics
import autosklearn.classification
X, y = sklearn.datasets.load_breast_cancer(return_X_y=True)
automl = autosklearn.classification.AutoSklearnClassifier(
    time_left_for_this_task=30,
    per_run_time_limit=1,
    tmp_folder='/tmp/autosklearn_classification_example_tmp',
    output_folder='/tmp/autosklearn_classification_example_out',
)
automl.fit(X, y, dataset_name='breast_cancer')
print(automl.show_models())

Actual behavior, stacktrace or logfile

Traceback (most recent call last):
  File "example_classification.py", line 40, in <module>
    print(automl.show_models())
  File "automl/lib/python3.7/site-packages/autosklearn/estimators.py", line 482, in show_models
    return self.automl_.show_models()
  File "automl/lib/python3.7/site-packages/autosklearn/automl.py", line 1355, in show_models
    sio.write("(%f, %s),\n" % (weight, model))
  File "automl/lib/python3.7/site-packages/sklearn/base.py", line 260, in __repr__
    repr_ = pp.pformat(self)
  File "automl/lib/python3.7/site-packages/python3.7/pprint.py", line 144, in pformat
    self._format(object, sio, 0, 0, {}, 0)
  File "automl/lib/python3.7/site-packages/python3.7/pprint.py", line 161, in _format
    rep = self._repr(object, context, level)
  File "automl/lib/python3.7/site-packages/python3.7/pprint.py", line 393, in _repr
    self._depth, level)
  File "automl/lib/python3.7/site-packages/sklearn/utils/_pprint.py", line 181, in format
    changed_only=self._changed_only)
  File "automl/lib/python3.7/site-packages/sklearn/utils/_pprint.py", line 425, in _safe_repr
    params = _changed_params(object)
  File "automl/lib/python3.7/site-packages/sklearn/utils/_pprint.py", line 91, in _changed_params
    params = estimator.get_params(deep=False)
  File "automl/lib/python3.7/site-packages/sklearn/base.py", line 195, in get_params
    value = getattr(self, key)
AttributeError: 'MyDummyClassifier' object has no attribute 'dataset_properties'

Looks like change here is causing the issue. Please help me understand why new params are added here? Let me know if new added params are required. I can submit a fix based on that.

Environment and installation:

Please give details about your installation:

  • Is your installation in a virtual environment or conda environment? - Virtual env
  • Python version - 3.7.3
  • Auto-sklearn version - development branch

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ricomscommented, Apr 20, 2021

no need for apologies @mfeurer . You are doing a great job on auto-sklearn! Thanks a lot for all your work!

1reaction
mfeurercommented, Apr 20, 2021

Sorry @ricoms and @rabsr, I just forgot to upload to pypi. I just fixed that now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dummy Regressor - GeeksforGeeks
The Dummy Regressor is a kind of Regressor that gives prediction based on simple strategies without paying any attention to the input Data....
Read more >
Dealing with Class Imbalance — Dummy Classifiers
A dummy classifier is basically a classifier which doesn't even look at the training data while classification, but follows just a rule of...
Read more >
How to use skearn's DummyRegressor method - Medium
In this post I intend to discuss sklearn's DummyRegressor, which makes predictions using very simple rules. The DummyRegressor is a useful tool ...
Read more >
Comparing with a dummy regressor | Python Data Analysis ...
The scikit-learn DummyRegressor class implements several strategies for random guessing, which can serve as baseline for regressors.
Read more >
Why Using a Dummy Classifier is a Smart Move
A dummy classifier is exactly what it sounds like! It is a classifier model that makes predictions without trying to find patterns in...
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