# optuna.distributions.check_distribution_compatibility¶

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 (optuna.distributions.BaseDistribution) – A distribution previously recorded in storage.

• dist_new (optuna.distributions.BaseDistribution) – A distribution newly added to storage.

Returns

True denotes given distributions are compatible. Otherwise, they are not.

Raises

ValueError – If different distribution kinds are set to dist_old and dist_new, or dist_old.choices doesn’t match dist_new.choices for CategoricalDistribution.

Return type

None