mlos_core.util
Internal helper functions for mlos_core package.
Functions
|
Converts a ConfigSpace config to a DataFrame. |
|
Remove all key-value pairs where the value is None. |
|
Convert a dictionary to a valid ConfigSpace configuration. |
Module Contents
- mlos_core.util.config_to_dataframe(config: ConfigSpace.Configuration) pandas.DataFrame [source]
Converts a ConfigSpace config to a DataFrame.
- Parameters:
config (ConfigSpace.Configuration) – The config to convert.
- Returns:
A DataFrame with a single row, containing the config’s parameters.
- Return type:
- mlos_core.util.drop_nulls(d: dict) dict [source]
Remove all key-value pairs where the value is None.
- mlos_core.util.normalize_config(config_space: ConfigSpace.ConfigurationSpace, config: ConfigSpace.Configuration | dict) ConfigSpace.Configuration [source]
Convert a dictionary to a valid ConfigSpace configuration.
Some optimizers and adapters ignore ConfigSpace conditionals when proposing new configurations. We have to manually remove inactive hyperparameters such suggestions.
- Parameters:
config_space (ConfigSpace.ConfigurationSpace) – The parameter space to use.
config (dict) – The configuration to convert.
- Returns:
cs_config – A valid ConfigSpace configuration with inactive parameters removed.
- Return type: