VizierTuner
VizierTuner ¶
VizierTuner(
num_trials: int = 100,
automatic_search_space: bool = False,
parallel_trials: int = 1,
max_trial_duration: Optional[float] = None,
*,
cross_validation: bool = False,
cross_validation_num_folds: Optional[int] = None
)
Bases: AbstractTuner
Tuner using Vizier.
Attributes:
| Name | Type | Description |
|---|---|---|
num_trials |
Number of hyperparameter configurations to evaluate. |
|
automatic_search_space |
If true, automatically define the search space of hyperparameters. In this case, configuring the hyperparameters manually (e.g. calling "choice(...)" on the tuner) is not necessary. |
|
parallel_trials |
int
|
Number of trials to evaluate in parallel. The training of
an individual model uses "num_threads" threads (configured in the
learner). Therefore, in the non-distributed training setting, the total
number of threads will be |
max_trial_duration |
int
|
Maximum training duration of an individual trial
expressed in seconds. This parameter is different from the
|
cross_validation |
int
|
Use cross-validation for evaluating the hyperparameter candidates. Cross-validation can provide better evaluation quality but is much slower. |
cross_validation_num_folds |
int
|
Number of folds to use for cross-validation. Defaults to 5 if not set. |
Initializes tuner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
optimizer_key
|
str
|
Registered identifier of the optimizer. |
required |
automatic_search_space
|
bool
|
If true, automatically define the search space of hyperparameters. In this case, configuring the hyperparameters manually (e.g. calling "choice(...)" on the tuner) is not necessary. |
False
|
parallel_trials
|
int
|
Number of trials to evaluate in parallel. The training of
an individual model uses "num_threads" threads (configured in the
learner). Therefore, in the non-distributed training setting, the total
number of threads will be |
1
|
max_trial_duration
|
Optional[float]
|
Maximum training duration of an individual trial
expressed in seconds. This parameter is different from the
|
None
|
cross_validation
|
bool
|
Use cross-validation for evaluating the hyperparameter candidates. Cross-validation can provide better evaluation quality but is much slower. |
False
|
cross_validation_num_folds
|
Optional[int]
|
Number of folds to use for cross-validation. Defaults to 10 if not set. |
None
|
choice ¶
Adds a hyperparameter with a list of possible values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Name of the hyperparameter. |
required |
values
|
HyperParameterSequence
|
List of possible values. |
required |
merge
|
bool
|
If false (default), raises an error if the hyperparameter already exist. If true, and if the hyperparameter already exist, adds "values" to the already configured values. If true, and if the hyperparameter does not already exist, raises an error. |
False
|
Returns:
| Type | Description |
|---|---|
SearchSpace
|
The conditional SearchSpace corresponding to the values in "values". |
set_base_learner_num_threads ¶
Sets the number of threads in the base learner.