Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Fix random-search #180

Merged
merged 8 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions tests/test_randomizedsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ def _test_method(self, search_method, **kwargs):
refit=True,
**kwargs)
tune_search.fit(x, y)
self.assertEquals(len(tune_search.cv_results_["params"]), 3)
params = tune_search.best_estimator_.get_params()
print({
k: v
Expand Down
1 change: 0 additions & 1 deletion tune_sklearn/tune_basesearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ def _fit(self, X, y=None, groups=None, **fit_params):
Returns:
:obj:`TuneBaseSearchCV` child instance, after fitting.
"""

self._check_params()
classifier = is_classifier(self.estimator)
cv = check_cv(cv=self.cv, y=y, classifier=classifier)
Expand Down
2 changes: 1 addition & 1 deletion tune_sklearn/tune_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def _fill_config_hyperparam(self, config):
for key, distribution in self.param_distributions.items():
if isinstance(distribution, Domain):
config[key] = distribution
all_lists = False
elif isinstance(distribution, list):
import random

Expand Down Expand Up @@ -628,7 +629,6 @@ def _tune_run(self, config, resources_per_trial):
stopper = MaximumIterationStopper(max_iter=max_iter)
if self.stopper:
stopper = CombinedStopper(stopper, self.stopper)

run_args = dict(
scheduler=self.early_stopping,
reuse_actors=True,
Expand Down