Plotting Utils#

Plotting utility functions

boa.plotting.plot_contours(scheduler: Union[Scheduler, PathLike, str], metric_names: list[str] = None, title: str = 'Metric Contours Plot', **kwargs)[source]#

Plot predictions for a 2-d slice of the parameter space.

Parameters
  • scheduler (Union[Scheduler, PathLike, str]) – Initialized scheduler or path to scheduler.json file.

  • metric_names (list[str]) – metric name or list of metric names to restrict dropdowns to. If None, will use all metric names.

  • title (str) – The title of plot

  • **kwargs – key word arguments to pass to AXs plot_contour_plotly

boa.plotting.plot_metrics_trace(schedulers: Union[List[Scheduler], List[Union[PathLike, str]], Scheduler, PathLike, str], metric_names: list[str] = None, title: str = 'Metric Performance vs. # of Iterations', **kwargs)[source]#

Plots an optimization trace with mean and 2 SEMs

Parameters
  • schedulers (Union[List[Scheduler], List[Union[PathLike, str]], Scheduler, PathLike, str]) – List of initialized scheduler or path to scheduler.json file or single initialized scheduler or path to scheduler.json file

  • metric_names (list[str]) – metric name or list of metric names to restrict dropdowns to. If None, will use all metric names.

  • title (str) – The title of plot

  • **kwargs – key word arguments to pass to AXs optimization_trace_single_method_plotly

boa.plotting.plot_pareto_frontier(scheduler: Union[Scheduler, PathLike, str], metric_names: list[str] | None = None, num_points: int = 20, CI_level: float = 0.9)[source]#

Plot a Pareto frontier from a scheduler.

Parameters
  • scheduler (Union[Scheduler, PathLike, str]) – Initialized scheduler or path to scheduler.json file.

  • metric_names (list[str] | None) – metric name or list of metric names to restrict dropdowns to. If None, will use all metric names.

  • num_points (int) – The number of points to compute on the Pareto frontier.

  • CI_level (float) – The confidence level, i.e. 0.95 (95%)

boa.plotting.plot_slice(scheduler: Union[Scheduler, PathLike, str], **kwargs)[source]#

Create interactive plot with predictions for a 1-d slice of the parameter space.

Parameters
  • scheduler (Union[Scheduler, PathLike, str]) – Initialized scheduler or path to scheduler.json file.

  • **kwargs – key word arguments to pass to AXs interact_slice_plotly

boa.plotting.scheduler_to_df(scheduler: Union[Scheduler, PathLike, str], **kwargs) DataFrame[source]#

Transforms an scheduler’s experiment to a DataFrame with rows keyed by trial_index and arm_name, metrics pivoted into one row. If the pivot results in more than one row per arm (or one row per arm * map_keys combination if map_keys are present), results are omitted and warning is produced.

Transforms an Experiment into a pd.DataFrame.

Parameters
  • scheduler (Union[Scheduler, PathLike, str]) – Initialized scheduler or path to scheduler.json file.

  • **kwargs – key word arguments to pass to AXs exp_to_df

Returns

  • A dataframe of inputs, metadata and metrics by trial and arm (and

  • map_keys, if present). If no trials are available, returns an empty

  • dataframe.

Return type

DataFrame

boa.plotting.app_view(scheduler: Union[Scheduler, PathLike, str], metric_names: list[str] | None = None)[source]#

Creates a web view of a variety of EDA plots from a scheduler.

Parameters
  • scheduler (Union[Scheduler, PathLike, str]) – Initialized scheduler or path to scheduler.json file.

  • metric_names (list[str] | None) – metric name or list of metric names to restrict dropdowns to. If None, will use all metric names.