class_docstr: Test the ClassificationScoreVisualizer base functionality
docstr: Ensure a human-understandable error is raised when decode fails
docstr_tok: ["Ensure","a","human-understandable","error","is","raised","when","decode","fails"]
code: def test_decode_labels_unknown_class(self):
      """
      Ensure a human-understandable error is raised when decode fails
      """
      classes = np.array(["a", "b", "c", "d", "e"])
      y = classes[np.random.randint(0, 5, 100)]
  
      # Remove class "c" from the known array labels
      classes = np.array(["a", "b", "d", "e"])
  
      oz = ClassificationScoreVisualizer(GaussianNB, classes=classes)
      with pytest.raises(ModelError, match="could not decode"):
          npt.assert_array_equal(oz._decode_labels(y), decoded)
  
      encoder = dict(zip(classes, range(len(classes))))
      oz = ClassificationScoreVisualizer(GaussianNB, encoder=encoder)
      with pytest.raises(
          ModelError, match="cannot decode class 'c' to label"
      ):
          npt.assert_array_equal(oz._decode_labels(y), decoded)
  
      encoder = LabelEncoder().fit(
          classes[np.random.randint(0, 4, 100)]
      )
      oz = ClassificationScoreVisualizer(GaussianNB, encoder=encoder)
      with pytest.raises(ModelError, match="could not decode"):
          npt.assert_array_equal(oz._decode_labels(y), decoded)
  
imports: import pytest
  import numpy
  import numpy.testing
  from yellowbrick.classifier.base import *
  from sklearn.naive_bayes import GaussianNB
  from sklearn.preprocessing import LabelEncoder
  from sklearn.linear_model import LinearRegression
  from .conftest import assert_fitted, assert_not_fitted
  from yellowbrick.exceptions import YellowbrickTypeError
label_desc: Use image node_id 10 for calling the TestClassificationScoreVisualizer obj's underlying member method code with example usage: obj.test_decode_labels_unknown_class() without return types