mlos_core.optimizers.flaml_optimizer module¶
Contains the FlamlOptimizer class.
- class mlos_core.optimizers.flaml_optimizer.EvaluatedSample(config: dict, score: float)¶
Bases:
NamedTuple
A named tuple representing a sample that has been evaluated.
Methods
count
(value, /)Return number of occurrences of value.
index
(value[, start, stop])Return first index of value.
- config: dict¶
Alias for field number 0
- score: float¶
Alias for field number 1
- 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)¶
Bases:
BaseOptimizer
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.
- 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.