Skip to content

plot_results


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

Plot of the model results after the evaluation. If all models applied bootstrap, the plot is a boxplot. If not, the plot is a barplot. Models are ordered based on their score from the top down. The score is either the mean_bootstrap or metric_test attribute of the model, selected in that order.

Parameters:

models: str, sequence or None, optional (default=None)
Name of the models to plot. If None, all models in the pipeline 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=None)
Figure's size, format as (x, y). If None, it adapts the size to the number of models shown.

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(["QDA", "Tree", "RF", "ET", "LGB"], metric="f1", n_bootstrap=5)
atom.plot_results()  # With bootstrap...
plot_results
# And without bootstrap...
atom.run(["QDA", "Tree", "RF", "ET", "LGB"], metric="f1", n_bootstrap=0)
atom.plot_results()
plot_results
Back to top