class_docstr: The prediction error visualizer plots the actual targets from the dataset
  against the predicted values generated by our model(s). This visualizer is
  used to detect noise or heteroscedasticity along a range of the target
  domain.
  
  Parameters
  ----------
  
  estimator : a Scikit-Learn regressor
      Should be an instance of a regressor, otherwise will raise a
      YellowbrickTypeError exception on instantiation.
      If the estimator is not fitted, it is fit when the visualizer is fitted,
      unless otherwise specified by ``is_fitted``.
  
  ax : matplotlib Axes, default: None
      The axes to plot the figure on. If None is passed in the current axes
      will be used (or generated if required).
  
  shared_limits : bool, default: True
      If shared_limits is True, the range of the X and Y axis limits will
      be identical, creating a square graphic with a true 45 degree line.
      In this form, it is easier to diagnose under- or over- prediction,
      though the figure will become more sparse. To localize points, set
      shared_limits to False, but note that this will distort the figure
      and should be accounted for during analysis.
  
  bestfit : bool, default: True
      Draw a linear best fit line to estimate the correlation between the
      predicted and measured value of the target variable. The color of
      the bestfit line is determined by the ``line_color`` argument.
  
  identity : bool, default: True
      Draw the 45 degree identity line, y=x in order to better show the
      relationship or pattern of the residuals. E.g. to estimate if the
      model is over- or under- estimating the given values. The color of the
      identity line is a muted version of the ``line_color`` argument.
  
  alpha : float, default: 0.75
      Specify a transparency where 1 is completely opaque and 0 is completely
      transparent. This property makes densely clustered points more visible.
  
  is_fitted : bool or str, default='auto'
      Specify if the wrapped estimator is already fitted. If False, the estimator
      will be fit when the visualizer is fit, otherwise, the estimator will not be
      modified. If 'auto' (default), a helper method will check if the estimator
      is fitted before fitting it again.
  
  kwargs : dict
      Keyword arguments that are passed to the base class and may influence
      the visualization as defined in other Visualizers.
  
  Attributes
  ----------
  
  score_ : float
      The R^2 score that specifies the goodness of fit of the underlying
      regression model to the test data.
  
  Examples
  --------
  
  >>> from yellowbrick.regressor import PredictionError
  >>> from sklearn.linear_model import Lasso
  >>> model = PredictionError(Lasso())
  >>> model.fit(X_train, y_train)
  >>> model.score(X_test, y_test)
  >>> model.show()
  
  Notes
  -----
  
  PredictionError is a ScoreVisualizer, meaning that it wraps a model and
  its primary entry point is the `score()` method.
docstr: Parameters
  ----------
  y : ndarray or Series of length n
      An array or series of target or class values
  
  y_pred : ndarray or Series of length n
      An array or series of predicted target values
  
  Returns
  -------
  ax : matplotlib Axes
      The axis with the plotted figure
docstr_tok: ["Parameters","--","--","--","--","--","y",":","ndarray","or","Series","of","length","n","An","array","or","series","of","target","or","class","values","y_pred",":","ndarray","or","Series","of","length","n","An","array","or","series","of","predicted","target","values","Returns","--","--","--","-","ax",":","matplotlib","Axes","The","axis","with","the","plotted","figure"]
code: def draw(self, y, y_pred):
      """
      Parameters
      ----------
      y : ndarray or Series of length n
          An array or series of target or class values
  
      y_pred : ndarray or Series of length n
          An array or series of predicted target values
  
      Returns
      -------
      ax : matplotlib Axes
          The axis with the plotted figure
      """
  
      # Some estimators particularly cross validation ones
      # tend to provide choice to use different metrics for scoring,
      # which we try to cater here
      # If not available it falls back to the default score of R2.
      try:
          score_label = self.estimator.scoring
          score_label = " ".join(score_label.split("_")).capitalize()
      except AttributeError:
          score_label = "R2"
  
      if score_label == "R2":
          score_label = "$R^2$"
  
      label = "{} $ = {:0.3f}$".format(score_label, self.score_)
  
      self.ax.scatter(
          y,
          y_pred,
          c=self.colors["point"],
          alpha=self.alpha,
          label=label,
      )
  
      # TODO If score happens inside a loop, draw gets called multiple times.
      # Ideally we'd want the best fit line to be drawn only once
      if self.bestfit:
          draw_best_fit(
              y,
              y_pred,
              self.ax,
              "linear",
              ls="--",
              lw=2,
              c=self.colors["line"],
              label="best fit",
          )
  
      # Set the axes limits based on the overall max/min values of
      # concatenated X and Y data
      # NOTE: shared_limits will be accounted for in finalize()
      if self.shared_limits is True:
          self.ax.set_xlim(
              min(min(y), min(y_pred)), max(max(y), max(y_pred))
          )
          self.ax.set_ylim(self.ax.get_xlim())
  
      return self.ax
  
file_path: yellowbrick/yellowbrick/regressor/prediction_error.py
imports: from yellowbrick.style.palettes import LINE_COLOR
  from yellowbrick.exceptions import YellowbrickValueError
  from yellowbrick.bestfit import draw_best_fit, draw_identity_line
  from yellowbrick.regressor.base import RegressionScoreVisualizer
label_desc: Use image node_id 3 for calling the PredictionError obj's underlying member method code with example usage: obj.draw(y, y_pred) and returns: self