class_docstr: Base class for classifier model selection.
  
  The ClassificationScoreVisualizer wraps a classifier to produce a
  visualization when the score method is called, usually to allow the user
  to effectively compare the performance between models.
  
  The base class provides helper functionality to ensure that classification
  visualizers are able to correctly identify and encode classes with human
  readable labels and to map colors to the classes if required.
  
  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).
  
  fig : matplotlib Figure, default: None
      The figure to plot the Visualizer on. If None is passed in the current
      plot 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.
  
  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.
  
  kwargs : dict
      Keyword arguments passed to the visualizer base classes.
  
  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 metric.
docstr: The score function is the hook for visual interaction. Pass in test
  data and the visualizer will create predictions on the data and
  evaluate them with respect to the test values. The evaluation will
  then be passed to draw() and the result of the estimator score will
  be returned.
  
  Parameters
  ----------
  X : array-like
      X (also X_test) are the dependent variables of test set to predict
  
  y : array-like
      y (also y_test) is the independent actual variables to score against
  
  Returns
  -------
  score : float
      Returns the score of the underlying model, usually accuracy for
      classification models. Refer to the specific model for more details.
docstr_tok: ["The","score","function","is","the","hook","for","visual","interaction",".","Pass","in","test","data","and","the","visualizer","will","create","predictions","on","the","data","and","evaluate","them","with","respect","to","the","test","values",".","The","evaluation","will","then","be","passed","to","draw","(",")","and","the","result","of","the","estimator","score","will","be","returned",".","Parameters","--","--","--","--","--","X",":","array-like","X","(","also","X_test",")","are","the","dependent","variables","of","test","set","to","predict","y",":","array-like","y","(","also","y_test",")","is","the","independent","actual","variables","to","score","against","Returns","--","--","--","-","score",":","float","Returns","the","score","of","the","underlying","model",",","usually","accuracy","for","classification","models",".","Refer","to","the","specific","model","for","more","details","."]
code: def score(self, X, y):
      """
      The score function is the hook for visual interaction. Pass in test
      data and the visualizer will create predictions on the data and
      evaluate them with respect to the test values. The evaluation will
      then be passed to draw() and the result of the estimator score will
      be returned.
  
      Parameters
      ----------
      X : array-like
          X (also X_test) are the dependent variables of test set to predict
  
      y : array-like
          y (also y_test) is the independent actual variables to score against
  
      Returns
      -------
      score : float
          Returns the score of the underlying model, usually accuracy for
          classification models. Refer to the specific model for more details.
      """
      # If the estimator has been passed in fitted but the visualizer was not fit
      # then we can retrieve the classes from the estimator, unfortunately we cannot
      # retrieve the class counts so we simply set them to None and warn the user.
      # NOTE: cannot test if hasattr(self, "classes_") because it will be proxied.
      if not hasattr(self, "class_counts_"):
          if not hasattr(self.estimator, "classes_"):
              raise NotFitted(
                  (
                      "could not determine required property classes_; "
                      "the visualizer must either be fit or instantiated with a "
                      "fitted classifier before calling score()"
                  )
              )
  
          self.class_counts_ = None
          self.classes_ = self._decode_labels(self.estimator.classes_)
          warnings.warn(
              "could not determine class_counts_ from previously fitted classifier",
              YellowbrickWarning,
          )
  
      # This method implements ScoreVisualizer (do not call super).
      self.score_ = self.estimator.score(X, y)
      return self.score_
  
file_path: yellowbrick/yellowbrick/classifier/base.py
imports: import warnings
  import numpy
  from yellowbrick.utils import isclassifier
  from yellowbrick.base import ScoreVisualizer
  from yellowbrick.style.palettes import color_palette
  from yellowbrick.exceptions import NotFitted, YellowbrickWarning
  from yellowbrick.exceptions import YellowbrickTypeError, ModelError
  from sklearn.preprocessing import LabelEncoder
label_desc: Use image node_id 4 for calling the ClassificationScoreVisualizer obj's underlying member method code with example usage: obj.score(X, y) and returns: self