class_docstr: Test ConfusionMatrix visualizer
class_docstr_tok: ["Test","ConfusionMatrix","visualizer"]
docstr: Test that ConfusionMatrix score() returns a score between 0 and 1
docstr_tok: ["Test","that","ConfusionMatrix","score","(",")","returns","a","score","between","0","and","1"]
code: def test_score_returns_score(self):
      """
      Test that ConfusionMatrix score() returns a score between 0 and 1
      """
      # Load the occupancy dataset from fixtures
      X, y = load_occupancy(return_dataset=True).to_numpy()
      X_train, X_test, y_train, y_test = tts(
          X, y, test_size=0.2, random_state=42
      )
  
      # Create and fit the visualizer
      visualizer = ConfusionMatrix(LogisticRegression())
      visualizer.fit(X_train, y_train)
  
      # Score the visualizer
      s = visualizer.score(X_test, y_test)
  
      assert 0 <= s <= 1
  
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 12 for calling the TestConfusionMatrix obj's underlying member method code with example usage: obj.test_score_returns_score() without return types