Skip to content

plot_bo


method plot_bo(models=None, metric=0, title=None, figsize=(10, 8), filename=None, display=True) [source]

Plot the bayesian optimization scores. Only for models that ran hyperparameter tuning. This is the same plot as the one produced by bo_params={"plot": True} while running the BO. Creates a canvas with two plots: the first plot shows the score of every trial and the second shows the distance between the last consecutive steps.

Parameters:

models: str, sequence or None, optional (default=None)
Name of the models to plot. If None, all models in the pipeline that used bayesian optimization are selected.

metric: int or str, optional (default=0)
Index or name of the metric to plot. Only for multi-metric runs.

title: str or None, optional (default=None)
Plot's title. If None, the title is left empty.

figsize: tuple, optional (default=(10, 8))
Figure's size, format as (x, y).

filename: str or None, optional (default=None)
Name of the file. Use "auto" for automatic naming. If None, the figure is not saved.

display: bool or None, optional (default=True)
Whether to render the plot. If None, it returns the matplotlib figure.

Returns: fig: matplotlib.figure.Figure
Plot object. Only returned if display=None.


Example

from atom import ATOMClassifier

atom = ATOMClassifier(X, y)
atom.run(["LDA", "LGB"], metric="f1", n_calls=24, n_initial_points=10)
atom.plot_bo()
plot_bo
Back to top