class_docstr: Visualization of the prediction error of a regression model.
  
  This tool can display "residuals vs predicted" or "actual vs predicted"
  using scatter plots to qualitatively assess the behavior of a regressor,
  preferably on held-out data points.
  
  See the details in the docstrings of
  :func:`~sklearn.metrics.PredictionErrorDisplay.from_estimator` or
  :func:`~sklearn.metrics.PredictionErrorDisplay.from_predictions` to
  create a visualizer. All parameters are stored as attributes.
  
  For general information regarding `scikit-learn` visualization tools, read
  more in the :ref:`Visualization Guide <visualizations>`.
  For details regarding interpreting these plots, refer to the
  :ref:`Model Evaluation Guide <visualization_regression_evaluation>`.
  
  .. versionadded:: 1.2
  
  Parameters
  ----------
  y_true : ndarray of shape (n_samples,)
      True values.
  
  y_pred : ndarray of shape (n_samples,)
      Prediction values.
  
  Attributes
  ----------
  line_ : matplotlib Artist
      Optimal line representing `y_true == y_pred`. Therefore, it is a
      diagonal line for `kind="predictions"` and a horizontal line for
      `kind="residuals"`.
  
  errors_lines_ : matplotlib Artist or None
      Residual lines. If `with_errors=False`, then it is set to `None`.
  
  scatter_ : matplotlib Artist
      Scatter data points.
  
  ax_ : matplotlib Axes
      Axes with the different matplotlib axis.
  
  figure_ : matplotlib Figure
      Figure containing the scatter and lines.
  
  See Also
  --------
  PredictionErrorDisplay.from_estimator : Prediction error visualization
      given an estimator and some data.
  PredictionErrorDisplay.from_predictions : Prediction error visualization
      given the true and predicted targets.
  
  Examples
  --------
  >>> import matplotlib.pyplot as plt
  >>> from sklearn.datasets import load_diabetes
  >>> from sklearn.linear_model import Ridge
  >>> from sklearn.metrics import PredictionErrorDisplay
  >>> X, y = load_diabetes(return_X_y=True)
  >>> ridge = Ridge().fit(X, y)
  >>> y_pred = ridge.predict(X)
  >>> display = PredictionErrorDisplay(y_true=y, y_pred=y_pred)
  >>> display.plot()
  <...>
  >>> plt.show()
code: def __init__(self, *, y_true, y_pred):
      self.y_true = y_true
      self.y_pred = y_pred
  
imports: import numbers
  import numpy
  from ...utils import _safe_indexing, check_matplotlib_support, check_random_state
label_desc: Use image node_id 1 to create a new PredictionErrorDisplay object  with example: obj = PredictionErrorDisplay()