residual_plot

Contents

residual_plot#

class braintools.visualize.residual_plot(y_true, y_pred, ax=None, figsize=(10, 6), color='blue', alpha=0.7, xlabel='Predicted Values', ylabel='Residuals', title='Residual Plot', **kwargs)#

Create residual plot for regression diagnostics.

Parameters:
  • y_true (ndarray) – True and predicted values.

  • y_pred (ndarray) – True and predicted values.

  • ax (Axes | None) – Axes to plot on.

  • figsize (Tuple[float, float]) – Figure size if creating new figure.

  • color (str) – Plot color.

  • alpha (float) – Alpha transparency.

  • xlabel (str) – Axis labels and title.

  • ylabel (str) – Axis labels and title.

  • title (str) – Axis labels and title.

  • **kwargs – Additional arguments passed to scatter.

Returns:

ax – The axes object containing the plot.

Return type:

Axes