optuna.multi_objective.trial.MultiObjectiveTrial
- class optuna.multi_objective.trial.MultiObjectiveTrial(trial)[source]
A trial is a process of evaluating an objective function.
This object is passed to an objective function and provides interfaces to get parameter suggestion, manage the trial’s state, and set/get user-defined attributes of the trial.
Note that the direct use of this constructor is not recommended. This object is seamlessly instantiated and passed to the objective function behind the
optuna.multi_objective.study.MultiObjectiveStudy.optimize()
method; hence library users do not care about instantiation of this object.Warning
Deprecated in v2.4.0. This feature will be removed in the future. The removal of this feature is currently scheduled for v4.0.0, but this schedule is subject to change. See https://github.com/optuna/optuna/releases/tag/v2.4.0.
Methods
report
(values, step)Report intermediate objective function values for a given step.
set_system_attr
(key, value)Set system attributes to the trial.
set_user_attr
(key, value)Set user attributes to the trial.
suggest_categorical
(name, choices)Suggest a value for the categorical parameter.
suggest_discrete_uniform
(name, low, high, q)Suggest a value for the discrete parameter.
suggest_float
(name, low, high, *[, step, log])Suggest a value for the floating point parameter.
suggest_int
(name, low, high[, step, log])Suggest a value for the integer parameter.
suggest_loguniform
(name, low, high)Suggest a value for the continuous parameter.
suggest_uniform
(name, low, high)Suggest a value for the continuous parameter.
Attributes
Return start datetime.
Return distributions of parameters to be optimized.
Return trial's number which is consecutive and unique in a study.
Return parameters to be optimized.
Return system attributes.
Return user attributes.
- property datetime_start: Optional[datetime]
Return start datetime.
- Returns
Datetime where the
Trial
started.
- property distributions: Dict[str, BaseDistribution]
Return distributions of parameters to be optimized.
- Returns
A dictionary containing all distributions.
- property number: int
Return trial’s number which is consecutive and unique in a study.
- Returns
A trial number.
- property params: Dict[str, Any]
Return parameters to be optimized.
- Returns
A dictionary containing all parameters.
- report(values, step)[source]
Report intermediate objective function values for a given step.
The reported values are used by the pruners to determine whether this trial should be pruned.
See also
Please refer to
BasePruner
.Note
The reported values are converted to
float
type by applyingfloat()
function internally. Thus, it accepts all float-like types (e.g.,numpy.float32
). If the conversion fails, aTypeError
is raised.
- set_system_attr(key, value)[source]
Set system attributes to the trial.
Please refer to the documentation of
optuna.trial.Trial.set_system_attr()
for further details.
- set_user_attr(key, value)[source]
Set user attributes to the trial.
Please refer to the documentation of
optuna.trial.Trial.set_user_attr()
for further details.
- suggest_categorical(name, choices)[source]
Suggest a value for the categorical parameter.
Please refer to the documentation of
optuna.trial.Trial.suggest_categorical()
for further details.
- suggest_discrete_uniform(name, low, high, q)[source]
Suggest a value for the discrete parameter.
Please refer to the documentation of
optuna.trial.Trial.suggest_discrete_uniform()
for further details.
- suggest_float(name, low, high, *, step=None, log=False)[source]
Suggest a value for the floating point parameter.
Please refer to the documentation of
optuna.trial.Trial.suggest_float()
for further details.
- suggest_int(name, low, high, step=1, log=False)[source]
Suggest a value for the integer parameter.
Please refer to the documentation of
optuna.trial.Trial.suggest_int()
for further details.
- suggest_loguniform(name, low, high)[source]
Suggest a value for the continuous parameter.
Please refer to the documentation of
optuna.trial.Trial.suggest_loguniform()
for further details.
- suggest_uniform(name, low, high)[source]
Suggest a value for the continuous parameter.
Please refer to the documentation of
optuna.trial.Trial.suggest_uniform()
for further details.