optuna.distributions.IntDistribution

class optuna.distributions.IntDistribution(low, high, log=False, step=1)[source]

整数の分布を表すクラス。

suggest_int() によってインスタンス化され、 samplers モジュールで一般的に使用されます。

Note

stepNone でない場合、範囲 \([\mathsf{low}, \mathsf{high}]\)\(\mathsf{step}\) で割り切れない場合、\(\mathsf{high}\)\(k \times \mathsf{step} + \mathsf{low} < \mathsf{high}\) の最大値に置き換えられます。 ここで \(k\) は整数です。

Parameters:
low

分布の範囲の下限。low は範囲に含まれます。 lowhigh 以下でなければなりません。logTrue の場合、 low は 1 以上でなければなりません。

high

分布の範囲の上限。high は範囲に含まれます。 highlow 以上でなければなりません。

log

logTrue の場合、この分布は対数スケールで扱われます。 この場合、分布にエンキューされるすべてのパラメータは正の値でなければなりません。 パラメータ step が 1 でない場合、このパラメータは False でなければなりません。

step

離散化のステップサイズ。step は正の整数でなければなりません。 パラメータ logTrue の場合、このパラメータは 1 でなければなりません。

メソッド

single()

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

to_external_repr(param_value_in_internal_repr)

Convert internal representation of a parameter value into external representation.

to_internal_repr(param_value_in_external_repr)

Convert external representation of a parameter value into internal representation.

single()[source]

この分布の範囲が単一の値のみを含むかどうかをテストします。

Returns:

この分布の範囲が単一の値のみを含む場合は True、それ以外の場合は False

Return type:

bool

to_external_repr(param_value_in_internal_repr)[source]

パラメータ値の内部表現を外部表現に変換します。

Parameters:

param_value_in_internal_repr (float) – パラメータ値の Optuna 内部表現。

Returns:

パラメータ値の Optuna 外部表現。

Return type:

int

to_internal_repr(param_value_in_external_repr)[source]

パラメータ値の外部表現を内部表現に変換します。

Parameters:

param_value_in_external_repr (int) – パラメータ値の Optuna 外部表現。

Returns:

パラメータ値の Optuna 内部表現。

Return type:

float