Choice
Bases: Collection[T]
A list of values to choose from in a hyperparameter search.
Source code in src/safeds/ml/hyperparameters/_choice.py
elements = list(args)
instance-attribute
¶
__contains__(value)
¶
Check if a value is in this choice.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Any
|
The value to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
is_in_choice |
bool
|
Whether the value is in this choice. |
Source code in src/safeds/ml/hyperparameters/_choice.py
__init__(*args)
¶
Create a new choice.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args |
T
|
The values to choose from. |
()
|
__iter__()
¶
Iterate over the values of this choice.
Returns:
Name | Type | Description |
---|---|---|
iterator |
Iterator[T]
|
An iterator over the values of this choice. |
__len__()
¶
Get the number of values in this choice.
Returns:
Name | Type | Description |
---|---|---|
number_of_values |
int
|
The number of values in this choice. |