class_docstr: Test ConfusionMatrix visualizer
class_docstr_tok: ["Test","ConfusionMatrix","visualizer"]
docstr: Test confusion matrix in percent mode on digits dataset with SVC
docstr_tok: ["Test","confusion","matrix","in","percent","mode","on","digits","dataset","with","SVC"]
code: def test_percent_mode(self):
      """
      Test confusion matrix in percent mode on digits dataset with SVC
      """
      _, ax = plt.subplots()
  
      model = SVC(random_state=93)
      cm = ConfusionMatrix(model, ax=ax, percent=True)
  
      cm.fit(self.digits.X.train, self.digits.y.train)
      cm.score(self.digits.X.test, self.digits.y.test)
  
      self.assert_images_similar(cm, tol=10)
  
      # Ensure correct confusion matrix under the hood
      npt.assert_array_equal(
          cm.confusion_matrix_,
          np.array(
              [
                  [38, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                  [0, 37, 0, 0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 39, 0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 38, 0, 1, 0, 1, 1, 0],
                  [0, 0, 0, 0, 41, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 27, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0, 30, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0, 0, 35, 0, 1],
                  [0, 0, 0, 0, 0, 0, 0, 0, 34, 0],
                  [0, 0, 0, 0, 0, 0, 0, 1, 0, 36],
              ]
          ),
      )
  
imports: import sys
  import pytest
  import yellowbrick
  import numpy.testing
  import matplotlib.pyplot
  from yellowbrick.exceptions import ModelError
  from yellowbrick.datasets import load_occupancy
  from yellowbrick.classifier.confusion_matrix import *
  from unittest.mock import patch
  from tests.fixtures import Dataset, Split
  from tests.base import IS_WINDOWS_OR_CONDA, VisualTestCase
  from sklearn.svm import SVC
  from sklearn.naive_bayes import GaussianNB
  from sklearn.preprocessing import LabelEncoder
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.linear_model import LogisticRegression
  from sklearn.linear_model import PassiveAggressiveRegressor
  from sklearn.model_selection import train_test_split
  from sklearn.datasets import load_digits, make_classification
  from sklearn.preprocessing import MinMaxScaler
  from sklearn.pipeline import Pipeline
label_desc: Use image node_id 4 for calling the TestConfusionMatrix obj's underlying member method code with example usage: obj.test_percent_mode() without return types