Skip to content

Commit 0690a4d

Browse files
[Fix] stale only-labels (#1134)
* [FIX] clone test of dummy estimator (#1129) * [FIX] clone test of dummy estimator * [FIX] flake8 * [Fix] stale only-labels * [Fix] Mark as stale if any of the provided labels
1 parent 28f22e7 commit 0690a4d

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

.github/workflows/stale.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ jobs:
1818
close-issue-message: >
1919
This issue has been automatically closed due to inactivity.
2020
stale-issue-label: 'stale'
21-
only-issue-labels: 'Answered,Feedback-Required,invalid,wontfix'
21+
# Only issues with ANY of these labels are checked.
22+
# Separate multiple labels with commas (eg. "incomplete,waiting-feedback").
23+
any-of-issue-labels: 'Answered,Feedback-Required,invalid,wontfix'
2224
exempt-all-milestones: true

test/test_automl/test_automl.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import pandas as pd
1313
import pytest
1414
import sklearn.datasets
15-
from sklearn.base import clone
1615
from smac.scenario.scenario import Scenario
1716
from smac.facade.roar_facade import ROAR
1817

@@ -427,16 +426,6 @@ def test_do_dummy_prediction(backend, dask_client, datasets):
427426
'predictions_ensemble_1_1_0.0.npy')
428427
)
429428

430-
model_path = os.path.join(backend.temporary_directory, '.auto-sklearn',
431-
'runs', '1_1_0.0',
432-
'1.1.0.0.model')
433-
434-
# Make sure the dummy model complies with scikit learn
435-
# get/set params
436-
assert os.path.exists(model_path)
437-
with open(model_path, 'rb') as model_handler:
438-
clone(pickle.load(model_handler))
439-
440429
auto._clean_logger()
441430

442431
del auto
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import numpy as np
2+
3+
import pytest
4+
5+
from sklearn.base import clone
6+
from sklearn.datasets import make_classification, make_regression
7+
from sklearn.utils.validation import check_is_fitted
8+
9+
from autosklearn.evaluation.abstract_evaluator import MyDummyClassifier, MyDummyRegressor
10+
11+
12+
@pytest.mark.parametrize("task_type", ['classification', 'regression'])
13+
def test_dummy_pipeline(task_type):
14+
if task_type == 'classification':
15+
estimator_class = MyDummyClassifier
16+
data_maker = make_classification
17+
elif task_type == 'regression':
18+
estimator_class = MyDummyRegressor
19+
data_maker = make_regression
20+
else:
21+
pytest.fail(task_type)
22+
23+
estimator = estimator_class(config=1, random_state=np.random.RandomState(42))
24+
X, y = data_maker()
25+
estimator.fit(X, y)
26+
check_is_fitted(estimator)
27+
28+
assert np.shape(X)[0] == np.shape(estimator.predict(X))[0]
29+
30+
# make sure we comply with scikit-learn estimator API
31+
clone(estimator)

0 commit comments

Comments
 (0)