discrete#

Parameters that can only be sampled at specific values

Classes

Param_Categorical(name, categories[, ...])

Represents an categorical parameter; a discrete parameter without an order.

Param_Discrete(name, categories[, ...])

Represents a discrete parameter.

Param_Discrete_Numeric(name, categories[, ...])

Represents an discrete numeric parameter; an ordinal parameter comprised of numbers.

Param_Ordinal(name, categories[, ...])

Represents an ordinal parameter; a discrete parameter with an order.

Task(name, categories[, search_categories])

Represents an task parameter; a discrete parameter indicating a distinct system.

class obsidian.parameters.discrete.Param_Categorical(name: str, categories: str | list[str], search_categories: list[str] | None = None)[source]#

Bases: Param_Discrete

Represents an categorical parameter; a discrete parameter without an order.

decode(X: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])[source]#

Decode parameter from transformed space

encode(X: str | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | bytes | _NestedSequence[bool | int | float | complex | str | bytes])[source]#

Encode parameter to a format that can be used for training

class obsidian.parameters.discrete.Param_Discrete(name: str, categories: str | list[str], search_categories: list[str] | None = None)[source]#

Bases: Parameter

Represents a discrete parameter.

name#

The name of the parameter.

Type:

str

categories#

The categories of the parameter.

Type:

list[str]

Properties:

min (int): The minimum value of the parameter (always 0). nc (int): The number of categories. max (int): The maximum value of the parameter (nc - 1).

property max#

Maximum parameter value (nc-1)

property min#

Minimum parameter value (always 0 for discrete)

property nc#

Number of discrete categories

Set the search space to the parameter space

Set the search space for the parameter

Parameters:

search_categories (list[str]) – The search space for the parameter.

class obsidian.parameters.discrete.Param_Discrete_Numeric(name, categories: list[int | float], search_categories: list[int | float] | None = None)[source]#

Bases: Param_Discrete

Represents an discrete numeric parameter; an ordinal parameter comprised of numbers.

Raises:
  • TypeError – If the categories are not numbers.

  • TypeError – If the categories are not a list of numbers.

decode(X)#

Decode parameter from transformed space

encode(X)#

Encode parameter to a format that can be used for training

property max#

Maximum parameter value

property min#

Minimum parameter value

property range#

The range of the parameter (max - min)

class obsidian.parameters.discrete.Param_Ordinal(name: str, categories: str | list[str], search_categories: list[str] | None = None)[source]#

Bases: Param_Discrete

Represents an ordinal parameter; a discrete parameter with an order.

decode(X: ndarray)[source]#

Decode parameter from transformed space

encode(X: ndarray)[source]#

Encode parameter to a format that can be used for training

class obsidian.parameters.discrete.Task(name: str, categories: str | list[str], search_categories: list[str] | None = None)[source]#

Bases: Param_Discrete

Represents an task parameter; a discrete parameter indicating a distinct system.

decode(X)#

Decode parameter from transformed space

encode(X)#

Encode parameter to a format that can be used for training