# Structs¶

class optuna.structs.TrialState[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.

class optuna.structs.StudyDirection[source]

Direction of a Study.

NOT_SET

Direction has not been set.

MINIMIZE

Study minimizes the objective function.

MAXIMIZE

Study maximizes the objective function.

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

Status and results of a Trial.

number

Unique and consecutive number of Trial for each Study. Note that this field uses zero-based numbering.

state
value

Objective value of the Trial.

datetime_start

Datetime where the Trial started.

datetime_complete

Datetime where the Trial finished.

params

Dictionary that contains suggested parameters.

distributions

Dictionary that contains the distributions of params.

user_attrs

Dictionary that contains the attributes of the Trial set with optuna.trial.Trial.set_user_attr().

intermediate_values

Intermediate objective values set with optuna.trial.Trial.report().

distributions

Return the distributions for this trial.

Returns: The distributions.
class optuna.structs.StudySummary(study_name, direction, best_trial, user_attrs, system_attrs, n_trials, datetime_start, study_id)[source]

Basic attributes and aggregated results of a Study.

study_name

Name of the Study.

direction
best_trial

FrozenTrial with best objective value in the Study.

user_attrs

Dictionary that contains the attributes of the Study set with optuna.study.Study.set_user_attr().

system_attrs

Dictionary that contains the attributes of the Study internally set by Optuna.

n_trials

The number of trials ran in the Study.

datetime_start

Datetime where the Study started.

study_id

Return the study ID.

Deprecated since version 0.20.0: The direct use of this attribute is deprecated and it is recommended that you use study_name instead.

Returns: The study ID.