Param_Categorical#

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.

__init__(name: str, categories: str | list[str], search_categories: list[str] | None = None)#

Methods

__init__(name, categories[, search_categories])

decode(X)

Decode parameter from transformed space

encode(X)

Encode parameter to a format that can be used for training

load_state(obj_dict)

Load the state of the Parameter object from a dictionary.

open_search()

Set the search space to the parameter space

save_state()

Save the state of the Parameter object.

set_search(search_categories)

Set the search space for the parameter

unit_demap(X)

unit_map(X)

Attributes

max

Maximum parameter value (nc-1)

min

Minimum parameter value (always 0 for discrete)

nc

Number of discrete categories

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