mlos_core.spaces.adapters.adapter

Contains the BaseSpaceAdapter abstract class.

As mentioned in mlos_core.spaces.adapters, the space adapters provide a mechanism for automatic transformation of the original ConfigSpace.ConfigurationSpace provided to the Optimizer into a new space for the Optimizer to search over.

It’s main APIs are the transform() and inverse_transform() methods, which are used to translate configurations from one space to another.

Classes

BaseSpaceAdapter

SpaceAdapter abstract class defining the basic interface.

Module Contents

class mlos_core.spaces.adapters.adapter.BaseSpaceAdapter(*, orig_parameter_space: ConfigSpace.ConfigurationSpace)[source]

SpaceAdapter abstract class defining the basic interface.

Parameters:

orig_parameter_space (ConfigSpace.ConfigurationSpace) – The original parameter space to explore.

__repr__() str[source]
Return type:

str

abstract inverse_transform(configurations: pandas.DataFrame) pandas.DataFrame[source]

Translates a configuration, which belongs to the original parameter space, to the target parameter space. This method is called by the register method of the BaseOptimizer class, and performs the inverse operation of transform() method.

Parameters:

configurations (pandas.DataFrame) – Dataframe of configurations / parameters, which belong to the original parameter space. The columns are the parameter names the original parameter space and the rows are the configurations.

Returns:

configurations – Dataframe of the translated configurations / parameters. The columns are the parameter names of the target parameter space and the rows are the configurations.

Return type:

pandas.DataFrame

abstract transform(configuration: pandas.DataFrame) pandas.DataFrame[source]

Translates a configuration, which belongs to the target parameter space, to the original parameter space. This method is called by the suggest() method of the BaseOptimizer class.

Parameters:

configuration (pandas.DataFrame) – Pandas dataframe with a single row. Column names are the parameter names of the target parameter space.

Returns:

configuration – Pandas dataframe with a single row, containing the translated configuration. Column names are the parameter names of the original parameter space.

Return type:

pandas.DataFrame

property orig_parameter_space: ConfigSpace.ConfigurationSpace[source]

Original (user-provided) parameter space to explore.

Return type:

ConfigSpace.ConfigurationSpace

property target_parameter_space: ConfigSpace.ConfigurationSpace[source]
Abstractmethod:

Return type:

ConfigSpace.ConfigurationSpace

Target parameter space that is fed to the underlying optimizer.