class_docstr: Tests for the ScoreVisualizer
class_docstr_tok: ["Tests","for","the","ScoreVisualizer"]
docstr: Test that visualizer properly handles an already-fitted model
code: def test_with_fitted(self):
      """
      Test that visualizer properly handles an already-fitted model
      """
      X, y = load_occupancy(return_dataset=True).to_numpy()
  
      model = LinearSVC().fit(X, y)
      classes = ["unoccupied", "occupied"]
  
      with patch.object(model, "fit") as mockfit:
          oz = MockVisualizer(model, classes=classes)
          oz.fit(X, y)
          mockfit.assert_not_called()
  
      with patch.object(model, "fit") as mockfit:
          oz = MockVisualizer(model, classes=classes, is_fitted=True)
          oz.fit(X, y)
          mockfit.assert_not_called()
  
      with patch.object(model, "fit") as mockfit:
          oz = MockVisualizer(model, classes=classes, is_fitted=False)
          oz.fit(X, y)
          mockfit.assert_called_once_with(X, y)
  
imports: import pytest
  import matplotlib.pyplot
  from yellowbrick.base import *
  from yellowbrick.base import VisualizerGrid
  from yellowbrick.datasets import load_occupancy
  from yellowbrick.exceptions import YellowbrickWarning
  from yellowbrick.exceptions import YellowbrickValueError
  from unittest.mock import patch
  from unittest.mock import MagicMock
  from tests.rand import RandomVisualizer
  from tests.base import IS_WINDOWS_OR_CONDA, VisualTestCase
  from sklearn.svm import LinearSVC
  from sklearn.datasets import make_classification
label_desc: Use image node_id 1 for calling the TestScoreVisualizer obj's underlying member method code with example usage: obj.test_with_fitted() without return types