Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions autosklearn/evaluation/abstract_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def __init__(
super(MyDummyClassifier, self).__init__(strategy="most_frequent")
self.random_state = random_state
self.init_params = init_params
self.dataset_properties = dataset_properties
self.include = include
self.exclude = exclude

def pre_transform(
self,
Expand Down Expand Up @@ -110,6 +113,9 @@ def __init__(
super(MyDummyRegressor, self).__init__(strategy='median')
self.random_state = random_state
self.init_params = init_params
self.dataset_properties = dataset_properties
self.include = include
self.exclude = exclude

def pre_transform(
self,
Expand Down
11 changes: 11 additions & 0 deletions test/test_automl/test_automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import pandas as pd
import pytest
import sklearn.datasets
from sklearn.base import clone
from smac.scenario.scenario import Scenario
from smac.facade.roar_facade import ROAR

Expand Down Expand Up @@ -426,6 +427,16 @@ def test_do_dummy_prediction(backend, dask_client, datasets):
'predictions_ensemble_1_1_0.0.npy')
)

model_path = os.path.join(backend.temporary_directory, '.auto-sklearn',
Copy link
Contributor

Choose a reason for hiding this comment

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

While I think we should test for the dummy models complying with sklearn, we should not do so here. Could you please create a test in the evaluation module tests?

'runs', '1_1_0.0',
'1.1.0.0.model')

# Make sure the dummy model complies with scikit learn
# get/set params
assert os.path.exists(model_path)
with open(model_path, 'rb') as model_handler:
clone(pickle.load(model_handler))

auto._clean_logger()

del auto
Expand Down