class_docstr: Test the PCA visualizer
class_docstr_tok: ["Test","the","PCA","visualizer"]
docstr: Test discrete target.
docstr_tok: ["Test","discrete","target","."]
code: def test_discrete(self):
      """
      Test discrete target.
      """
      classes = ["a", "b", "c", "d", "e"]
      colors = ["r", "b", "g", "m", "c"]
  
      visualizer = PCA(colors=colors, classes=classes, random_state=83)
      assert not hasattr(visualizer, "classes_")
      visualizer.fit(*self.discrete)
      assert hasattr(visualizer, "classes_")
      assert not hasattr(visualizer, "range_")
      visualizer.transform(*self.discrete)
  
      # Make sure that classes are set correctly.
      npt.assert_array_equal(visualizer.classes_, classes)
  
      self.assert_images_similar(visualizer)
  
imports: import sys
  import pytest
  import numpy
  import numpy.testing
  from unittest import mock
  from tests.base import VisualTestCase, IS_WINDOWS_OR_CONDA
  from yellowbrick.features.pca import *
  from yellowbrick.exceptions import YellowbrickError, NotFitted
label_desc: Use image node_id 3 for calling the TestPCA obj's underlying member method code with example usage: obj.test_discrete() without return types