class_docstr: Test ConfusionMatrix visualizer
class_docstr_tok: ["Test","ConfusionMatrix","visualizer"]
docstr: Test with Pandas DataFrame and Series input
docstr_tok: ["Test","with","Pandas","DataFrame","and","Series","input"]
code: def test_pandas_integration(self):
      """
      Test with Pandas DataFrame and Series input
      """
      _, ax = plt.subplots()
  
      # Load the occupancy dataset from fixtures
      X, y = load_occupancy(return_dataset=True).to_pandas()
  
      # Create train/test splits
      splits = tts(X, y, test_size=0.2, random_state=8873)
      X_train, X_test, y_train, y_test = splits
  
      # Create confusion matrix
      model = GaussianNB()
      cm = ConfusionMatrix(model, ax=ax, classes=None)
      cm.fit(X_train, y_train)
      cm.score(X_test, y_test)
  
      self.assert_images_similar(cm, tol=0.1)
  
      # Ensure correct confusion matrix under the hood
      npt.assert_array_equal(
          cm.confusion_matrix_, np.array([[3012, 114], [1, 985]])
      )
  
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 9 for calling the TestConfusionMatrix obj's underlying member method code with example usage: obj.test_pandas_integration() without return types