Skip to content

plot_errors


method plot_errors(models=None, dataset="test", title=None, figsize=(10, 6), filename=None, display=True) [source]

Plot a model's prediction errors, i.e. the actual targets from a set against the predicted values generated by the regressor. A linear fit is made on the data. The gray, intersected line shows the identity line. This pot can be useful to detect noise or heteroscedasticity along a range of the target domain. Only for regression tasks.

Parameters:

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

dataset: str, optional (default="test")
Data set on which to calculate the errors. Options are "train", "test" or "both".

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

figsize: tuple, optional (default=(10, 6))
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 ATOMRegressor

atom = ATOMRegressor(X, y)
atom.run(["OLS", "LGB"], metric="MAE")
atom.plot_errors()
plot_errors
Back to top