plot_boxplot

plot_boxplot(results, labels, relative=False, plot_type='violin', outliers=True, title=None, y_min=None, y_max=None)[source]

Plot a box plot.

Each row of results is an independent experiment for each element in names.

Parameters:
results: np.array

Scores (either accuracies or errors) of dataset x strategy

labels: list of estimators

List with names of the estimators

relative: bool, default = False

If True, the results for a given dataset are divided by the median result.

plot_type: str, default = “violin”

This function can create four sort of distribution plots: “violin”, “swarm”, “boxplot” or “strip”. “violin” plot features a kernel density estimation of the underlying distribution. “swarm” draws a categorical scatterplot with points adjusted to be non-overlapping. “strip” draws a categorical scatterplot using jitter to reduce overplotting.

outliers: bool, default = True

Only applies when plot_type is “boxplot”.

title: str, default = None

Title to be shown in the top of the plot.

y_min: float, default = None

Min value for the y_axis of the plot.

y_max: float, default = None

Max value for the y_axis of the plot.

Returns:
figmatplotlib.figure.Figure
axmatplotlib.axes.Axes

Examples

>>> from aeon.visualisation import plot_boxplot
>>> from aeon.benchmarking.results_loaders import get_estimator_results_as_array
>>> methods = ["IT", "WEASEL-Dilation", "HIVECOTE2", "FreshPRINCE"]
>>> results = get_estimator_results_as_array(estimators=methods) 
>>> plot = plot_boxplot(results[0], methods) 
>>> plot.show() 
>>> plot.savefig("boxplot.pdf")