mlos_core.optimizers.flaml_optimizer

Contains the FlamlOptimizer class.

Notes

See the Flaml Documentation for more details.

Classes

EvaluatedSample

A named tuple representing a sample that has been evaluated.

FlamlOptimizer

Wrapper class for FLAML Optimizer: A fast library for AutoML and tuning.

Module Contents

class mlos_core.optimizers.flaml_optimizer.EvaluatedSample[source]

Bases: NamedTuple

A named tuple representing a sample that has been evaluated.

config: dict[source]
score: float[source]
class mlos_core.optimizers.flaml_optimizer.FlamlOptimizer(*, parameter_space: ConfigSpace.ConfigurationSpace, optimization_targets: List[str], objective_weights: List[float] | None = None, space_adapter: mlos_core.spaces.adapters.adapter.BaseSpaceAdapter | None = None, low_cost_partial_config: dict | None = None, seed: int | None = None)[source]

Bases: mlos_core.optimizers.optimizer.BaseOptimizer

Wrapper class for FLAML Optimizer: A fast library for AutoML and tuning.

Create an MLOS wrapper for FLAML.

Parameters:
  • parameter_space (ConfigSpace.ConfigurationSpace) – The parameter space to optimize.

  • optimization_targets (List[str]) – The names of the optimization targets to minimize.

  • objective_weights (Optional[List[float]]) – Optional list of weights of optimization targets.

  • space_adapter (BaseSpaceAdapter) – The space adapter class to employ for parameter space transformations.

  • low_cost_partial_config (dict) – A dictionary from a subset of controlled dimensions to the initial low-cost values. More info: https://microsoft.github.io/FLAML/docs/FAQ#about-low_cost_partial_config-in-tune

  • seed (Optional[int]) – If provided, calls np.random.seed() with the provided value to set the seed globally at init.

abstract register_pending(pending: mlos_core.data_classes.Suggestion) None[source]

Registers the given suggestion as “pending”. That is it say, it has been suggested by the optimizer, and an experiment trial has been started. This can be useful for executing multiple trials in parallel, retry logic, etc.

Parameters:

pending (Suggestion) – The pending suggestion to register.

Return type:

None

evaluated_samples: Dict[ConfigSpace.Configuration, EvaluatedSample][source]
flaml_parameter_space: Dict[str, mlos_core.spaces.converters.flaml.FlamlDomain][source]
low_cost_partial_config = None[source]