optuna.structs

This module is deprecated, with former functionality moved to optuna.trial and optuna.study.

class optuna.structs.TrialState(value)[source]

State of a Trial.

RUNNING

The Trial is running.

COMPLETE

The Trial has been finished without any error.

PRUNED

The Trial has been pruned with TrialPruned.

FAIL

The Trial has failed due to an uncaught error.

Deprecated since version 1.4.0: This class is deprecated. Please use TrialState instead.

class optuna.structs.StudyDirection(value)[source]

Direction of a Study.

NOT_SET

Direction has not been set.

MINIMIZE

Study minimizes the objective function.

MAXIMIZE

Study maximizes the objective function.

Deprecated since version 1.4.0: This class is deprecated. Please use StudyDirection instead.

class optuna.structs.FrozenTrial(number, state, value, datetime_start, datetime_complete, params, distributions, user_attrs, system_attrs, intermediate_values, trial_id, *, values=None)[source]

Warning

Deprecated in v1.4.0. This feature will be removed in the future. The removal of this feature is currently scheduled for v3.0.0, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v1.4.0.

This class was moved to trial. Please use FrozenTrial instead.

property distributions

Dictionary that contains the distributions of params.

property duration

Return the elapsed time taken to complete the trial.

Returns

The duration.

property last_step

Return the maximum step of intermediate_values in the trial.

Returns

The maximum step of intermediates.

report(value, step)[source]

Interface of report function.

Since FrozenTrial is not pruned, this report function does nothing.

See also

Please refer to should_prune().

Parameters
  • value (float) – A value returned from the objective function.

  • step (int) – Step of the trial (e.g., Epoch of neural network training). Note that pruners assume that step starts at zero. For example, MedianPruner simply checks if step is less than n_warmup_steps as the warmup mechanism.

Return type

None

should_prune()[source]

Suggest whether the trial should be pruned or not.

The suggestion is always False regardless of a pruning algorithm.

Note

FrozenTrial only samples one combination of parameters.

Returns

False.

Return type

bool

class optuna.structs.StudySummary(study_name, direction, best_trial, user_attrs, system_attrs, n_trials, datetime_start, study_id, *, directions=None)[source]

Warning

Deprecated in v1.4.0. This feature will be removed in the future. The removal of this feature is currently scheduled for v3.0.0, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v1.4.0.

This class was moved to study. Please use StudySummary instead.