boa.wrapper.BaseWrapper#

class boa.wrapper.BaseWrapper#

Bases: object

Methods

fetch_trial_data

Retrieves the trial data and prepares it for the metric(s) used in the objective function.

load_config

Load config file and return a dictionary # TODO finish this

run_model

Runs a model by deploying a given trial.

set_trial_status

The trial gets polled from time to time to see if it is completed, failed, still running, etc.

wrapper_to_dict

Convert Ax experiment to a dictionary.

write_configs

fetch_trial_data(trial: BaseTrial, metric_properties: dict, metric_name: str, *args, **kwargs) dict#

Retrieves the trial data and prepares it for the metric(s) used in the objective function. The return value needs to be a dictionary with the keys matching the keys of the metric function used in the objective function. # TODO work on this description

Parameters:
  • trial (BaseTrial) –

  • metric_properties (dict) –

  • metric_name (str) –

Returns:

A dictionary with the keys matching the keys of the metric function

used in the objective

Return type:

dict

load_config(config_file: PathLike)#

Load config file and return a dictionary # TODO finish this

Parameters:

config_file (os.PathLike) – File path for the experiment configuration file

Returns:

loaded_config

Return type:

dict

run_model(trial: BaseTrial) None#

Runs a model by deploying a given trial.

Parameters:

trial (BaseTrial) –

set_trial_status(trial: BaseTrial) None#

The trial gets polled from time to time to see if it is completed, failed, still running, etc. This marks the trial as one of those options based on some criteria of the model. If the model is still running, don’t do anything with the trial.

Parameters:

trial (BaseTrial) –

Examples

trial.mark_completed() trial.mark_failed() trial.mark_abandoned() trial.mark_early_stopped()

See also

# TODO add sphinx link to ax trial status

wrapper_to_dict() dict#

Convert Ax experiment to a dictionary.