plot_scatter_predictions

plot_scatter_predictions(y, y_pred, title=None)[source]

Plot a scatter that compares actual and predicted values for a given dataset.

This scatter is generally useful for plotting predictions for Time Series Extrinsic Regression approaches, since the output is continuous. In case of Time Series Classification it will be similar to a confusion matrix.

Parameters:
y: np.array

Actual values.

y_pred: np.array

Predicted values.

title: str, default = None

Title to be shown in the top of the plot.

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

Examples

>>> from aeon.visualisation import plot_scatter_predictions
>>> from aeon.datasets import load_covid_3month
>>> from aeon.regression.feature_based import FreshPRINCERegressor  
>>> X_train, y_train = load_covid_3month(split="train")
>>> X_test, y_test = load_covid_3month(split="test")
>>> fp = FreshPRINCERegressor(n_estimators=10)  
>>> fp.fit(X_train, y_train)  
>>> y_pred_fp = fp.predict(X_test)  
>>> plot = plot_scatter_predictions(y_test, y_pred_fp, title="FP-Covid3Month")        
>>> plot.show()  
>>> plot.savefig("scatterplot_predictions.pdf")