syne_tune.optimizer.schedulers.transfer_learning.quantile_based.quantile_based_searcher module
- syne_tune.optimizer.schedulers.transfer_learning.quantile_based.quantile_based_searcher.extract_input_output(transfer_learning_evaluations, normalization, random_state)[source]
- syne_tune.optimizer.schedulers.transfer_learning.quantile_based.quantile_based_searcher.fit_model(config_space, transfer_learning_evaluations, normalization, max_fit_samples, random_state, model=XGBRegressor(base_score=None, booster=None, callbacks=None, colsample_bylevel=None, colsample_bynode=None, colsample_bytree=None, device=None, early_stopping_rounds=None, enable_categorical=False, eval_metric=None, feature_types=None, gamma=None, grow_policy=None, importance_type=None, interaction_constraints=None, learning_rate=None, max_bin=None, max_cat_threshold=None, max_cat_to_onehot=None, max_delta_step=None, max_depth=None, max_leaves=None, min_child_weight=None, missing=nan, monotone_constraints=None, multi_strategy=None, n_estimators=None, n_jobs=None, num_parallel_tree=None, random_state=None, ...))[source]
- syne_tune.optimizer.schedulers.transfer_learning.quantile_based.quantile_based_searcher.eval_model(model_pipeline, X, y)[source]
- syne_tune.optimizer.schedulers.transfer_learning.quantile_based.quantile_based_searcher.subsample(X, y, max_samples=10000, random_state=None)[source]
Subsample both X and y with
max_sampleselements. Ifmax_samplesis not set then X and y are returned as such and if it is set, the index of X is reset. :rtype:Tuple[DataFrame,array] :return: (X, y) withmax_samplessampled elements.
- class syne_tune.optimizer.schedulers.transfer_learning.quantile_based.quantile_based_searcher.QuantileBasedSurrogateSearcher(config_space, transfer_learning_evaluations, max_fit_samples=100000, normalization='gaussian', random_seed=None)[source]
Bases:
SingleObjectiveBaseSearcherImplements the transfer-learning method:
A Quantile-based Approach for Hyperparameter Transfer Learning.David Salinas, Huibin Shen, Valerio Perrone.ICML 2020.This is the Copula Thompson Sampling approach described in the paper where a surrogate is fitted on the transfer learning data to predict mean/variance of configuration performance given a hyperparameter. The surrogate is then sampled from and the best configurations are returned as next candidate to evaluate.
- Parameters:
config_space (
Dict[str,Any]) – Configuration space for the evaluation function.transfer_learning_evaluations (
Dict[str,TransferLearningTaskEvaluations]) – Dictionary from task name to offline evaluations.max_fit_samples (
int) – Maximum number to use when fitting the method. Defaults to 100000normalization (
str) – Default to “gaussian” which first computes the rank and then applies Gaussian inverse CDF. “standard” applies just standard normalization (remove mean and divide by variance) but can perform significantly worse.random_seed (
Optional[int]) – Seed for the random number generator.
- suggest(**kwargs)[source]
Suggest a new configuration.
Note: Query
_next_points_to_evaluate()for initial configs to return first.- Parameters:
kwargs – Extra information may be passed from scheduler to searcher
- Return type:
Optional[Dict[str,Any]]- Returns:
New configuration. The searcher may return None if a new configuration cannot be suggested. In this case, the tuning will stop. This happens if searchers never suggest the same config more than once, and all configs in the (finite) search space are exhausted.