class_docstr: Test ConfusionMatrix visualizer
class_docstr_tok: ["Test","ConfusionMatrix","visualizer"]
docstr: Test LabelEncoder as label encoder to define tick labels
docstr_tok: ["Test","LabelEncoder","as","label","encoder","to","define","tick","labels"]
code: def test_inverse_mapping(self):
      """
      Test LabelEncoder as label encoder to define tick labels
      """
      _, ax = plt.subplots()
  
      model = LogisticRegression(random_state=93)
      le = LabelEncoder()
      le.fit(
          [
              "zero",
              "one",
              "two",
              "three",
              "four",
              "five",
              "six",
              "seven",
              "eight",
              "nine",
          ]
      )
  
      cm = ConfusionMatrix(model, ax=ax, encoder=le)
      cm.fit(self.digits.X.train, self.digits.y.train)
      cm.score(self.digits.X.test, self.digits.y.test)
  
      xlabels = np.array([l.get_text() for l in ax.get_xticklabels()])
      npt.assert_array_equal(xlabels, le.classes_)
  
      ylabels = [l.get_text() for l in ax.get_yticklabels()]
      ylabels.reverse()
      ylabels = np.asarray(ylabels)
      npt.assert_array_equal(ylabels, le.classes_)
  
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 8 for calling the TestConfusionMatrix obj's underlying member method code with example usage: obj.test_inverse_mapping() without return types