code: def prediction_error(
      estimator,
      X_train,
      y_train,
      X_test=None,
      y_test=None,
      ax=None,
      shared_limits=True,
      bestfit=True,
      identity=True,
      alpha=0.75,
      is_fitted="auto",
      show=True,
      **kwargs,
  ):
      """Quickly plot a prediction error visualizer
  
      Plot the actual targets from the dataset against the
      predicted values generated by our model(s).
  
      This helper function is a quick wrapper to utilize the PredictionError
      ScoreVisualizer for one-off analysis.
  
      Parameters
      ----------
      estimator : the Scikit-Learn estimator (should be a 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``.
  
      X_train : ndarray or DataFrame of shape n x m
          A feature array of n instances with m features the model is trained on.
          Used to fit the visualizer and also to score the visualizer if test splits are
          not directly specified.
  
      y_train : ndarray or Series of length n
          An array or series of target or class values. Used to fit the visualizer and
          also to score the visualizer if test splits are not specified.
  
      X_test : ndarray or DataFrame of shape n x m, default: None
          An optional feature array of n instances with m features that the model
          is scored on if specified, using X_train as the training data.
  
      y_test : ndarray or Series of length n, default: None
          An optional array or series of target or class values that serve as actual
          labels for X_test for scoring purposes.
  
      ax : matplotlib Axes
          The axes to plot the figure on.
  
      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.
  
      show: bool, default: True
          If True, calls ``show()``, which in turn calls ``plt.show()`` however you cannot
          call ``plt.savefig`` from this signature, nor ``clear_figure``. If False, simply
          calls ``finalize()``
  
      kwargs : dict
          Keyword arguments that are passed to the base class and may influence
          the visualization as defined in other Visualizers.
  
      Returns
      -------
      ax : matplotlib Axes
          Returns the axes that the prediction error plot was drawn on.
      """
      # Instantiate the visualizer
      visualizer = PredictionError(
          estimator,
          ax,
          shared_limits=shared_limits,
          bestfit=bestfit,
          identity=identity,
          alpha=alpha,
          is_fitted=is_fitted,
          **kwargs,
      )
  
      visualizer.fit(X_train, y_train)
  
      # Scores the visualizer with X and y test if provided, X and y train if not
      if X_test is not None and y_test is not None:
          visualizer.score(X_test, y_test)
      elif X_test is not None or y_test is not None:
          raise YellowbrickValueError(
              "both X_test and y_test are required if one is specified"
          )
      else:
          visualizer.score(X_train, y_train)
  
      if show:
          visualizer.show()
      else:
          visualizer.finalize()
  
      # Return the axes object on the visualizer
      return visualizer
  
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 1 for calling a global function with example usage: prediction_error(estimator, X_train, y_train, X_test, y_test, ax, shared_limits, bestfit, identity, alpha, is_fitted, show) and returns: visualizer