Distributions¶

class optuna.distributions.UniformDistribution[source]

A uniform distribution in the linear domain.

This object is instantiated by suggest_uniform(), and passed to samplers in general.

low

Lower endpoint of the range of the distribution. low is included in the range.

high

Upper endpoint of the range of the distribution. high is excluded from the range.

single()[source]

Test whether the range of this distribution contains just a single value.

When this method returns True, samplers always sample the same value from the distribution.

Returns: True if the range of this distribution contains just a single value, otherwise False.
class optuna.distributions.LogUniformDistribution[source]

A uniform distribution in the log domain.

This object is instantiated by suggest_loguniform(), and passed to samplers in general.

low

Lower endpoint of the range of the distribution. low is included in the range.

high

Upper endpoint of the range of the distribution. high is excluded from the range.

single()[source]

Test whether the range of this distribution contains just a single value.

When this method returns True, samplers always sample the same value from the distribution.

Returns: True if the range of this distribution contains just a single value, otherwise False.
class optuna.distributions.DiscreteUniformDistribution[source]

A discretized uniform distribution in the linear domain.

This object is instantiated by suggest_discrete_uniform(), and passed to samplers in general.

low

Lower endpoint of the range of the distribution. low is included in the range.

high

Upper endpoint of the range of the distribution. high is included in the range.

q

A discretization step.

single()[source]

Test whether the range of this distribution contains just a single value.

When this method returns True, samplers always sample the same value from the distribution.

Returns: True if the range of this distribution contains just a single value, otherwise False.
class optuna.distributions.IntUniformDistribution[source]

A uniform distribution on integers.

This object is instantiated by suggest_int(), and passed to samplers in general.

low

Lower endpoint of the range of the distribution. low is included in the range.

high

Upper endpoint of the range of the distribution. high is included in the range.

single()[source]

Test whether the range of this distribution contains just a single value.

When this method returns True, samplers always sample the same value from the distribution.

Returns: True if the range of this distribution contains just a single value, otherwise False.
class optuna.distributions.CategoricalDistribution[source]

A categorical distribution.

This object is instantiated by suggest_categorical(), and passed to samplers in general.

choices

Candidates of parameter values.

single()[source]

Test whether the range of this distribution contains just a single value.

When this method returns True, samplers always sample the same value from the distribution.

Returns: True if the range of this distribution contains just a single value, otherwise False.
optuna.distributions.distribution_to_json(dist)[source]

Serialize a distribution to JSON format.

Parameters: dist – A distribution to be serialized. A JSON string of a given distribution.
optuna.distributions.json_to_distribution(json_str)[source]

Deserialize a distribution in JSON format.

Parameters: json_str – A JSON-serialized distribution. A deserialized distribution.
optuna.distributions.check_distribution_compatibility(dist_old, dist_new)[source]

A function to check compatibility of two distributions.

Note that this method is not supposed to be called by library users.

Parameters: dist_old – A distribution previously recorded in storage. dist_new – A distribution newly added to storage. True denotes given distributions are compatible. Otherwise, they are not.