class_docstr: Helper functions for K-Elbow Visualizer
class_docstr_tok: ["Helper","functions","for","K-Elbow","Visualizer"]
docstr: Ensure no ValueError is thrown when there are empty clusters #1185
code: def test_distortion_score_empty_clusters(self):
      """
      Ensure no ValueError is thrown when there are empty clusters #1185
      """
      X = np.array([[1, 2], [3, 4], [5, 6]])
      valuea = distortion_score(X, np.array([1, 3, 3]))
      valueb = distortion_score(X, np.array([0, 1, 1]))
      assert valuea == valueb
  
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 4 for calling the TestKElbowHelper obj's underlying member method code with example usage: obj.test_distortion_score_empty_clusters() without return types