class_docstr: Test ClassPredictionError visualizer
class_docstr_tok: ["Test","ClassPredictionError","visualizer"]
docstr: A model error should be raised when there are more classes in fit than score
docstr_tok: ["A","model","error","should","be","raised","when","there","are","more","classes","in","fit","than","score"]
code: def test_classes_greater_than_indices(self):
      """
      A model error should be raised when there are more classes in fit than score
      """
      X, y = load_occupancy(return_dataset=True).to_numpy()
      classes = ["unoccupied", "occupied", "partytime"]
  
      model = LinearSVC(random_state=42)
      model.fit(X, y)
      with pytest.raises(ModelError):
          visualizer = ClassPredictionError(model, classes=classes)
          visualizer.score(X, y)
  
imports: import pytest
  import matplotlib.pyplot
  from yellowbrick.exceptions import ModelError
  from yellowbrick.datasets import load_occupancy
  from yellowbrick.classifier.class_prediction_error import *
  from sklearn.svm import LinearSVC, SVC
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.datasets import make_multilabel_classification
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import MinMaxScaler
  from unittest.mock import patch
  from tests.base import VisualTestCase
label_desc: Use image node_id 6 for calling the TestClassPredictionError obj's underlying member method code with example usage: obj.test_classes_greater_than_indices() without return types