ray-project / tune-sklearn

A drop-in replacement for Scikit-Learn’s GridSearchCV / RandomizedSearchCV -- but with cutting edge hyperparameter tuning techniques.
https://docs.ray.io/en/master/tune/api_docs/sklearn.html
Apache License 2.0
465 stars 52 forks source link

ValueError: list of dictionaries for parameters is not supported for non-random search #227

Closed RNarayan73 closed 1 year ago

RNarayan73 commented 2 years ago

Hello, I am trying to pass a list of dictionaries to param_distributions in TuneSearchCV, but get the error:

C:\Anaconda3\envs\Scikit-Learn\lib\site-packages\tune_sklearn\tune_search.py in init(self, estimator, param_distributions, early_stopping, n_trials, scoring, n_jobs, refit, cv, verbose, random_state, error_score, return_train_score, local_dir, name, max_iters, search_optimization, use_gpu, loggers, pipeline_auto_early_stop, stopper, time_budget_s, sk_n_jobs, mode, search_kwargs, **kwargs) 366 if isinstance(param_distributions, list): 367 if self._search_optimization_lower != "random": --> 368 raise ValueError("list of dictionaries for parameters " 369 "is not supported for non-random search") 370

ValueError: list of dictionaries for parameters is not supported for non-random search

I've passed a list of dicts to the underlying search algorithm BayesSearchCV, but haven't tested it with the others and it works fine. Can list of dicts be enabled in general?

Thanks Narayan