You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
Scikit-learn 0.20 should allow you to reuse more of the existing BaseSearchCV infrastructure, by providing a protected method _run_search:
def_run_search(self, evaluate_candidates):
"""Repeatedly calls `evaluate_candidates` to conduct a search. This method, implemented in sub-classes, makes it is possible to customize the the scheduling of evaluations: GridSearchCV and RandomizedSearchCV schedule evaluations for their whole parameter search space at once but other more sequential approaches are also possible: for instance is possible to iteratively schedule evaluations for new regions of the parameter search space based on previously collected evaluation results. This makes it possible to implement Bayesian optimization or more generally sequential model-based optimization by deriving from the BaseSearchCV abstract base class. Parameters ---------- evaluate_candidates : callable This callback accepts a list of candidates, where each candidate is a dict of parameter settings. It returns a dict of all results so far, formatted like ``cv_results_``. Examples -------- :: def _run_search(self, evaluate_candidates): 'Try C=0.1 only if C=1 is better than C=10' all_results = evaluate_candidates([{'C': 1}, {'C': 10}]) score = all_results['mean_test_score'] if score[0] < score[1]: evaluate_candidates([{'C': 0.1}]) """
Using this would allow scikit-optimize to take advantage of new features in BaseSearchCV.
iaroslav-ai, drewszurko, jdb78, GuillemGSubies and harshit0511