class_docstr: Classification report that shows the precision, recall, F1, and support scores
  for the model. Integrates numerical scores as well as a 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``.
  
  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.
  
  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.
  
  Examples
  --------
  >>> from yellowbrick.classifier import ClassificationReport
  >>> from sklearn.linear_model import LogisticRegression
  >>> viz = ClassificationReport(LogisticRegression())
  >>> viz.fit(X_train, y_train)
  >>> viz.score(X_test, y_test)
  >>> viz.show()
  
  Attributes
  ----------
  classes_ : ndarray of shape (n_classes,)
      The class labels observed while fitting.
  
  class_count_ : ndarray of shape (n_classes,)
      Number of samples encountered for each class during fitting.
  
  score_ : float
      An evaluation metric of the classifier on test data produced when
      ``score()`` is called. This metric is between 0 and 1 -- higher scores are
      generally better. For classifiers, this score is usually accuracy, but
      ensure you check the underlying model for more details about the score.
  
  scores_ : dict of dicts
      Outer dictionary composed of precision, recall, f1, and support scores with
      inner dictionaries specifiying the values for each class listed.
class_docstr_tok: ["Classification","report","that","shows","the","precision",",","recall",",","F1",",","and","support","scores","for","the","model",".","Integrates","numerical","scores","as","well","as","a","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","``",".","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",".","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",".","Examples","--","--","--","--",">",">",">","from","yellowbrick.classifier","import","ClassificationReport",">",">",">","from","sklearn.linear_model","import","LogisticRegression",">",">",">","viz","=","ClassificationReport","(","LogisticRegression","(",")",")",">",">",">","viz.fit","(","X_train",",","y_train",")",">",">",">","viz.score","(","X_test",",","y_test",")",">",">",">","viz.show","(",")","Attributes","--","--","--","--","--","classes_",":","ndarray","of","shape","(","n_classes",",",")","The","class","labels","observed","while","fitting",".","class_count_",":","ndarray","of","shape","(","n_classes",",",")","Number","of","samples","encountered","for","each","class","during","fitting",".","score_",":","float","An","evaluation","metric","of","the","classifier","on","test","data","produced","when","``","score","(",")","``","is","called",".","This","metric","is","between","0","and","1","--","higher","scores","are","generally","better",".","For","classifiers",",","this","score","is","usually","accuracy",",","but","ensure","you","check","the","underlying","model","for","more","details","about","the","score",".","scores_",":","dict","of","dicts","Outer","dictionary","composed","of","precision",",","recall",",","f1",",","and","support","scores","with","inner","dictionaries","specifiying","the","values","for","each","class","listed","."]
docstr: Generates the Scikit-Learn classification report.
  
  Parameters
  ----------
  X : ndarray or DataFrame of shape n x m
      A matrix of n instances with m features
  
  y : ndarray or Series of length n
      An array or series of target or class values
  
  Returns
  -------
  
  score_ : float
      Global accuracy score
docstr_tok: ["Generates","the","Scikit-Learn","classification","report",".","Parameters","--","--","--","--","--","X",":","ndarray","or","DataFrame","of","shape","n","x","m","A","matrix","of","n","instances","with","m","features","y",":","ndarray","or","Series","of","length","n","An","array","or","series","of","target","or","class","values","Returns","--","--","--","-","score_",":","float","Global","accuracy","score"]
code: def score(self, X, y):
      """
      Generates the Scikit-Learn classification report.
  
      Parameters
      ----------
      X : ndarray or DataFrame of shape n x m
          A matrix of n instances with m features
  
      y : ndarray or Series of length n
          An array or series of target or class values
  
      Returns
      -------
  
      score_ : float
          Global accuracy score
      """
      # Call super to check if fitted and to compute self.score_
      super(ClassificationReport, self).score(X, y)
  
      # Labels must be a data type that works with np.isnan
      labels = range(len(self.classes_))
  
      y_pred = self.predict(X)
      scores = precision_recall_fscore_support(y, y_pred, labels=labels)
  
      # Calculate the percentage for the support metric
      # and store the percent in place of raw support counts
      self.support_score_ = scores[-1]
  
      scores = list(scores)
      scores[-1] = scores[-1] / scores[-1].sum()
  
      # Create a mapping composed of precision, recall, F1, and support
      # to their respective values
      scores = map(lambda s: dict(zip(self.classes_, s)), scores)
      self.scores_ = dict(zip(SCORES_KEYS, scores))
  
      # Remove support scores if not required
      if not self.support:
          self.scores_.pop("support")
  
      self.draw()
      return self.score_
  
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 2 for calling the ClassificationReport obj's underlying member method code with example usage: obj.score(X, y) and returns: self