deephyper.skopt.optimizer.acq_optimizer.pymoo_mixedga.Choice#
- class deephyper.skopt.optimizer.acq_optimizer.pymoo_mixedga.Choice(value: object | None = None, options: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None = None, all: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None = None, **kwargs: Any)[source]#
Bases:
Variable
Class for the representation of a discrete, subset decision variable.
Methods
Get the value of a decision variable.
Randomly sample
n
instances of a decision variable.Set the value of a decision variable.
- sample(n: int | None = None) object | ndarray #
Randomly sample
n
instances of a decision variable.- Parameters:
n (int, None) – Number of decision variable samples which to draw. If
int
, samplen
decision variables. IfNone
, sample a single decision variables.- Returns:
out – If
n
isint
, return anp.ndarray
of shape(n,)
containing sampled decision variables. Ifn
isNone
, return anobject
of a sampled decision variable.- Return type:
object, np.ndarray