Configuration
ConfigSpace.configuration
#
Configuration
#
Configuration(
configuration_space: ConfigurationSpace,
values: Mapping[str, Any] | None = None,
vector: Array[f64] | None = None,
allow_inactive_with_values: bool = False,
origin: Any | None = None,
config_id: int | None = None,
)
Class for a single configuration.
The Configuration object
holds for all active hyperparameters a value. While the
ConfigurationSpace
stores the definitions for the hyperparameters (value ranges, constraints,...),
a Configuration object is
more an instance of it. Parameters of a
Configuration object can be
accessed and modified similar to python dictionaries
(c.f. user guilde).
| PARAMETER | DESCRIPTION |
|---|---|
configuration_space |
The space this configuration is in
TYPE:
|
values |
A dictionary with pairs (hyperparameter_name, value), where value is a legal value of the hyperparameter in the above configuration_space |
vector |
A numpy array for efficient representation. Either values or vector has to be given |
allow_inactive_with_values |
Whether an Exception will be raised if a value for an inactive hyperparameter is given. Default is to raise an Exception. Default to False
TYPE:
|
origin |
Store information about the origin of this configuration. Defaults to None.
TYPE:
|
config_id |
Integer configuration ID which can be used by a program using the ConfigSpace package.
TYPE:
|
Source code in src/ConfigSpace/configuration.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
config_id
instance-attribute
#
The configuration id of the Configuration, sometimes used by tools working with ConfigSpace.
config_space
instance-attribute
#
config_space: ConfigurationSpace = configuration_space
The space this configuration is in.
origin
instance-attribute
#
The origin of the Configuration, sometimes used by tools working with ConfigSpace.
check_valid_configuration
#
Check if the object is a valid.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If configuration is not valid. |
Source code in src/ConfigSpace/configuration.py
get_array
#
get_dictionary
#
A representation of the Configuration in dictionary form.
Deprecated
Please use dict(config) instead of config.get_dictionary()
or use it as a dictionary directly if needed.,
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Configuration as dictionary |