mlos_core.optimizers.flaml_optimizer
.FlamlOptimizer¶
- class mlos_core.optimizers.flaml_optimizer.FlamlOptimizer(*, parameter_space: ConfigurationSpace, optimization_targets: List[str], objective_weights: List[float] | None = None, space_adapter: BaseSpaceAdapter | None = None, low_cost_partial_config: dict | None = None, seed: int | None = None)¶
Wrapper class for FLAML Optimizer: A fast library for AutoML and tuning.
- Attributes:
space_adapter
Get the space adapter instance (if any).
Methods
cleanup
()Remove temp files, release resources, etc.
get_best_observations
(*[, n_max])Get the N best observations so far as a triplet of DataFrames (config, score, context).
get_observations
()Returns the observations as a triplet of DataFrames (config, score, context).
register
(*, configs, scores[, context, metadata])Wrapper method, which employs the space adapter (if any), before registering the configs and scores.
register_pending
(*, configs[, context, metadata])Registers the given configs as "pending".
suggest
(*[, context, defaults])Wrapper method, which employs the space adapter (if any), after suggesting a new configuration.
- __init__(*, parameter_space: ConfigurationSpace, optimization_targets: List[str], objective_weights: List[float] | None = None, space_adapter: BaseSpaceAdapter | None = None, low_cost_partial_config: dict | None = None, seed: int | None = None)¶
Create an MLOS wrapper for FLAML.
- Parameters:
- parameter_spaceConfigSpace.ConfigurationSpace
The parameter space to optimize.
- optimization_targetsList[str]
The names of the optimization targets to minimize.
- objective_weightsOptional[List[float]]
Optional list of weights of optimization targets.
- space_adapterBaseSpaceAdapter
The space adapter class to employ for parameter space transformations.
- low_cost_partial_configdict
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
- seedOptional[int]
If provided, calls np.random.seed() with the provided value to set the seed globally at init.
- register_pending(*, configs: DataFrame, context: DataFrame | None = None, metadata: DataFrame | None = None) None ¶
Registers the given configs 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:
- configspd.DataFrame
Dataframe of configs / parameters. The columns are parameter names and the rows are the configs.
- contextpd.DataFrame
Not Yet Implemented.
- metadataOptional[pd.DataFrame]
Metadata returned by the backend optimizer’s suggest method.