mlos_core.util module¶
Internal helper functions for mlos_core package.
- mlos_core.util.config_to_dataframe(config: Configuration) DataFrame ¶
Converts a ConfigSpace config to a DataFrame.
- Parameters:
- configConfigSpace.Configuration
The config to convert.
- Returns:
- pd.DataFrame
A DataFrame with a single row, containing the config’s parameters.
- mlos_core.util.drop_nulls(d: dict) dict ¶
Remove all key-value pairs where the value is None.
- Parameters:
- ddict
The dictionary to clean.
- Returns:
- dict
The cleaned dictionary.
- mlos_core.util.normalize_config(config_space: ConfigurationSpace, config: Configuration | dict) Configuration ¶
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_spaceConfigurationSpace
The parameter space to use.
- configdict
The configuration to convert.
- Returns:
- cs_config: Configuration
A valid ConfigSpace configuration with inactive parameters removed.