class_docstr: Test DataVisualizer base class
class_docstr_tok: ["Test","DataVisualizer","base","class"]
code: def assert_fitted(self, obj, fields=FIELDS):
      __tracebackhide__ = True
      # Mutually exclusive fields
      if obj._target_color_type == TargetType.SINGLE:
          assert (not hasattr(obj, "classes_")) and (
              not hasattr(obj, "range_")
          )
  
      elif obj._target_color_type == TargetType.DISCRETE:
          assert hasattr(obj, "_label_encoder")
          assert hasattr(obj, "classes_") and (
              not hasattr(obj, "range_")
          )
  
      elif obj._target_color_type == TargetType.CONTINUOUS:
          assert (not hasattr(obj, "classes_")) and hasattr(
              obj, "range_"
          )
  
      else:
          raise ValueError(
              "cannot test target type {}".format(
                  obj._target_color_type
              )
          )
  
      for field in fields:
          if field in {"classes_", "range_", "_label_encoder"}:
              continue  # handled by mutually exclusive
          assert hasattr(obj, field)
  
imports: import pytest
  import numpy
  import numpy.testing
  from tests.fixtures import Dataset
  from yellowbrick.base import Visualizer
  from yellowbrick.features.base import *
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.datasets import make_classification, make_regression
  from unittest.mock import Mock
label_desc: Use image node_id 2 for calling the TestDataVisualizer obj's underlying member method code with example usage: obj.assert_fitted(obj, fields) without return types