class_docstr: Helper functions for K-Elbow Visualizer
class_docstr_tok: ["Helper","functions","for","K-Elbow","Visualizer"]
docstr: Test the distortion score metric on pandas DataFrame and Series
code: def test_distortion_score_pandas_input(self):
      """
      Test the distortion score metric on pandas DataFrame and Series
      """
      df = pd.DataFrame(self.clusters.X)
      s = pd.Series(self.clusters.y)
  
      score = distortion_score(df, s)
      assert score == pytest.approx(69.10006514142941)
  
imports: import sys
  import pytest
  import numpy
  import matplotlib.pyplot
  from scipy.sparse import csc_matrix, csr_matrix
  from numpy.testing import assert_array_almost_equal
  from sklearn.datasets import make_blobs
  from sklearn.cluster import KMeans, MiniBatchKMeans
  from sklearn.feature_extraction.text import TfidfVectorizer
  from tests.fixtures import Dataset
  from tests.base import VisualTestCase
  from yellowbrick.datasets import load_hobbies
  from yellowbrick.cluster.elbow import distortion_score
  from yellowbrick.cluster.elbow import KElbowVisualizer, kelbow_visualizer
  from yellowbrick.exceptions import YellowbrickValueError, YellowbrickWarning
  from tests.base import IS_WINDOWS_OR_CONDA
label_desc: Use image node_id 3 for calling the TestKElbowHelper obj's underlying member method code with example usage: obj.test_distortion_score_pandas_input() without return types