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

Add tests for `points_to_evaluate` #160

Closed krfricke closed 3 years ago

krfricke commented 3 years ago

This Ray PR adds points_to_evaluate for all search algorithms (except random search): https://github.com/ray-project/ray/pull/12790

This PR here adds tests for this in tune-sklearn. Points that should be evaluated first can be passed via the search_kwargs argument. E.g.:

        points = [{
            "alpha": 0.4,
            "epsilon": 0.01,
            "penalty": "elasticnet"
        }, {
            "alpha": 0.3,
            "epsilon": 0.02,
            "penalty": "l1"
        }]

        tune_search = TuneSearchCV(
            self.clf,
            self.parameter_grid,
            search_optimization=search_method,
            cv=2,
            n_trials=3,
            n_jobs=1,
            refit=True,
            points_to_evaluate=points)

Closes #73

Yard1 commented 3 years ago

Looks like something breaks with Hyperopt

krfricke commented 3 years ago

Might fix itself after https://github.com/ray-project/tune-sklearn/pull/160 gets merged.