plot_predictions

plot.plot_predictions(X, y, regressor, conformal=False, title='')

Plot predictions of a regressor along with the data.

Parameters

Name Type Description Default
X ndarray The input data to the regressor. A 2D array. required
y ndarray The target values. A 1D array of the same length as X. required
regressor object The regressor object. It should have a predict method that accepts X and returns predictions. required
conformal bool If True, the regressor is assumed to return prediction intervals (lower and upper bounds) along with the predictions. The prediction intervals are plotted as a shaded area. Default is False. False
title str The title of the plot. Default is an empty string. ''

Returns

Type Description
matplotlib.figure.Figure The figure object of the plot.
matplotlib.axes.Axes The axes object of the plot.

Notes

This function assumes that the predict method of regressor returns a tuple of three elements (predictions, lower bounds, upper bounds) when conformal is True.