code: def score(self, X, y):
          
          # Create predictions from X (will raise not fitted error)
          y_pred = self.predict(X)
  
          # Encode the target with the supplied label encoder
          if self.label_encoder:
              try :
                  y = self.label_encoder.inverse_transform(y)
                  y_pred = self.label_encoder.inverse_transform(y_pred)
              except AttributeError:
                  # if a mapping is passed to class apply it here.
                  y = np.array([self.label_encoder[x] for x in y])
                  y_pred = np.array([self.label_encoder[x] for x in y_pred])
  
          # Compute the confusion matrix and class counts
          self.confusion_matrix_ = confusion_matrix_metric(
              y, y_pred, labels=self.classes_, sample_weight=self.sample_weight
          )
          self.class_counts_ = self.class_counts(y)
  
          # Make array of only the classes actually being used.
          # Needed because sklearn confusion_matrix only returns counts for
          # selected classes but percent should be calculated on all classes
          selected_class_counts = []
          for c in self.classes_:
              try:
                  selected_class_counts.append(self.class_counts_[c])
              except KeyError:
                  selected_class_counts.append(0)
          self.class_counts_ = np.array(selected_class_counts)
  
          self.draw()
  
          # Retrieve and store the score attribute from the sklearn classifier
          self.score_ = self.estimator.score(X, y)
  
          return self.score_
docs: Draws a confusion matrix based on the test data supplied by comparing
          predictions on instances X with the true values specified by the
          target vector y.
  
          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