class_docstr: Test the ParallelCoordinates visualizer
class_docstr_tok: ["Test","the","ParallelCoordinates","visualizer"]
docstr: Assert output of subsampling method against expectations
docstr_tok: ["Assert","output","of","subsampling","method","against","expectations"]
code: def test_static_subsample():
      """
      Assert output of subsampling method against expectations
      """
  
      ntotal = 100
      ncols = 50
  
      y = np.arange(ntotal)
      X = np.ones((ntotal, ncols)) * y.reshape(ntotal, 1)
  
      visualizer = ParallelCoordinates(
          sample=1.0, random_state=None, shuffle=False
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X)
      assert np.array_equal(yprime, y)
  
      visualizer = ParallelCoordinates(
          sample=200, random_state=None, shuffle=False
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X)
      assert np.array_equal(yprime, y)
  
      sample = 50
      visualizer = ParallelCoordinates(
          sample=sample, random_state=None, shuffle=False
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X[:sample, :])
      assert np.array_equal(yprime, y[:sample])
  
      sample = 50
      visualizer = ParallelCoordinates(
          sample=sample, random_state=None, shuffle=True
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X[yprime.flatten(), :])
      assert len(Xprime) == sample
      assert len(yprime) == sample
  
      visualizer = ParallelCoordinates(
          sample=0.5, random_state=None, shuffle=False
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X[: int(ntotal / 2), :])
      assert np.array_equal(yprime, y[: int(ntotal / 2)])
  
      sample = 0.5
      visualizer = ParallelCoordinates(
          sample=sample, random_state=None, shuffle=True
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X[yprime.flatten(), :])
      assert len(Xprime) == ntotal * sample
      assert len(yprime) == ntotal * sample
  
      sample = 0.25
      visualizer = ParallelCoordinates(
          sample=sample, random_state=444, shuffle=True
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X[yprime.flatten(), :])
      assert len(Xprime) == ntotal * sample
      assert len(yprime) == ntotal * sample
  
      sample = 0.99
      visualizer = ParallelCoordinates(
          sample=sample,
          random_state=np.random.RandomState(),
          shuffle=True,
      )
      Xprime, yprime = visualizer._subsample(X, y)
      assert np.array_equal(Xprime, X[yprime.flatten(), :])
      assert len(Xprime) == ntotal * sample
      assert len(yprime) == ntotal * sample
  
imports: import pytest
  import numpy
  from yellowbrick.datasets import load_occupancy
  from yellowbrick.features.pcoords import *
  from tests.base import VisualTestCase
  from ..fixtures import Dataset
  from sklearn.datasets import make_classification
label_desc: Use image node_id 26 for calling the TestParallelCoordinates obj's underlying member method code with example usage: obj.test_static_subsample() without return types