ExpDesigner#

class obsidian.experiment.design.ExpDesigner(X_space: ParamSpace, seed: int | None = None)[source]#

Bases: object

ExpDesigner is a base class for designing experiments in a parameter space.

X_space#

The parameter space for the experiment.

Type:

ParamSpace

seed#

The randomization seed.

Type:

int | None

Raises:

TypeError – If X_space is not an obsidian ParamSpace object.

__init__(X_space: ParamSpace, seed: int | None = None)[source]#

Methods

__init__(X_space[, seed])

initialize([m_initial, method, sample_custom])

Initializes the experiment design.

initialize(m_initial: int | None = None, method: str = 'LHS', sample_custom: Tensor | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None) DataFrame[source]#

Initializes the experiment design.

Parameters:
  • m_initial (int) – The number of experiments to initialize.

  • method (str, optional) – The method to use for initialization. Defaults to 'LHS'.

  • seed (int | None, optional) – The randomization seed. Defaults to None.

  • sample_custom (Tensor | ArrayLike | None, optional) – Custom samples for initialization. Defaults to None.

Returns:

The initialized experiment design.

Return type:

pd.DataFrame

Raises:
  • KeyError – If method is not one of the supported methods.

  • ValueError – If sample_custom is None when method is ‘Custom’.

  • ValueError – If the number of columns in sample_custom does not match the size of the feature space.