code: def classification_report(
      estimator,
      X_train,
      y_train,
      X_test=None,
      y_test=None,
      ax=None,
      classes=None,
      cmap="YlOrRd",
      support=None,
      encoder=None,
      is_fitted="auto",
      force_model=False,
      show=True,
      colorbar=True,
      fontsize=None,
      **kwargs,
  ):
      """Classification Report
  
      Displays precision, recall, F1, and support scores for the model.
      Integrates numerical scores as well as color-coded heatmap.
  
      Parameters
      ----------
      estimator : estimator
          A scikit-learn estimator that should be a classifier. If the model is
          not a classifier, an exception is raised. If the internal model 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, default: None
          The axes to plot the figure on. If not specified the current axes will be
          used (or generated if required).
  
      classes : list of str, defult: None
          The class labels to use for the legend ordered by the index of the sorted
          classes discovered in the ``fit()`` method. Specifying classes in this
          manner is used to change the class names to a more specific format or
          to label encoded integer classes. Some visualizers may also use this
          field to filter the visualization for specific classes. For more advanced
          usage specify an encoder rather than class labels.
  
      cmap : string, default: ``'YlOrRd'``
          Specify a colormap to define the heatmap of the predicted class
          against the actual class in the classification report.
  
      support: {True, False, None, 'percent', 'count'}, default: None
          Specify if support will be displayed. It can be further defined by
          whether support should be reported as a raw count or percentage.
  
      encoder : dict or LabelEncoder, default: None
          A mapping of classes to human readable labels. Often there is a mismatch
          between desired class labels and those contained in the target variable
          passed to ``fit()`` or ``score()``. The encoder disambiguates this mismatch
          ensuring that classes are labeled correctly in the visualization.
  
      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.
  
      force_model : bool, default: False
          Do not check to ensure that the underlying estimator is a classifier. This
          will prevent an exception when the visualizer is initialized but may result
          in unexpected or unintended behavior.
  
      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()``
  
      colorbar : bool, default: True
          Specify if the color bar should be present
  
      fontsize : int or None, default: None
          Specify the font size of the x and y labels
  
      kwargs : dict
          Keyword arguments passed to the visualizer base classes.
  
      Returns
      -------
      viz : ClassificationReport
          Returns the fitted, finalized visualizer
      """
      # Instantiate the visualizer
      visualizer = ClassificationReport(
          estimator=estimator,
          ax=ax,
          classes=classes,
          cmap=cmap,
          support=support,
          encoder=encoder,
          is_fitted=is_fitted,
          force_model=force_model,
          colorbar=colorbar,
          fontsize=fontsize,
          **kwargs,
      )
  
      # Fit and transform the visualizer (calls draw)
      visualizer.fit(X_train, y_train)
  
      # Score the visualizer
      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)
  
      # Draw the final visualization
      if show:
          visualizer.show()
      else:
          visualizer.finalize()
  
      # Return the visualizer
      return visualizer
  
file_path: yellowbrick/yellowbrick/classifier/classification_report.py
imports: import numpy
  import matplotlib.pyplot
  from sklearn.metrics import precision_recall_fscore_support
  from yellowbrick.style import find_text_color
  from yellowbrick.style.palettes import color_sequence
  from yellowbrick.exceptions import YellowbrickValueError
  from yellowbrick.classifier.base import ClassificationScoreVisualizer
label_desc: Use image node_id 1 for calling a global function with example usage: classification_report(estimator, X_train, y_train, X_test, y_test, ax, classes, cmap, support, encoder, is_fitted, force_model, show, colorbar, fontsize) and returns: visualizer