code: def test_KMeans_scores(self):
      digits = datasets.load_digits()
      df = pdml.ModelFrame(digits)
  
      scaled = pp.scale(digits.data)
      df.data = df.data.pp.scale()
      self.assert_numpy_array_almost_equal(df.data.values, scaled)
  
      clf1 = cluster.KMeans(
          init="k-means++",
          n_clusters=10,
          n_init=10,
          random_state=self.random_state,
      )
      clf2 = df.cluster.KMeans(
          init="k-means++",
          n_clusters=10,
          n_init=10,
          random_state=self.random_state,
      )
      clf1.fit(scaled)
      df.fit_predict(clf2)
  
      expected = m.homogeneity_score(digits.target, clf1.labels_)
      self.assertEqual(df.metrics.homogeneity_score(), expected)
  
      expected = m.completeness_score(digits.target, clf1.labels_)
      self.assertEqual(df.metrics.completeness_score(), expected)
  
      expected = m.v_measure_score(digits.target, clf1.labels_)
      self.assertEqual(df.metrics.v_measure_score(), expected)
  
      expected = m.adjusted_rand_score(digits.target, clf1.labels_)
      self.assertEqual(df.metrics.adjusted_rand_score(), expected)
  
      expected = m.homogeneity_score(digits.target, clf1.labels_)
      self.assertEqual(df.metrics.homogeneity_score(), expected)
  
      expected = m.silhouette_score(
          scaled,
          clf1.labels_,
          metric="euclidean",
          sample_size=300,
          random_state=self.random_state,
      )
      result = df.metrics.silhouette_score(
          metric="euclidean",
          sample_size=300,
          random_state=self.random_state,
      )
      self.assertAlmostEqual(result, expected)
  
imports: import pytest
  import numpy
  import sklearn.datasets
  import sklearn.cluster
  import sklearn.preprocessing
  import sklearn.metrics
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 11 for calling the TestCluster obj's underlying member method code with example usage: obj.test_KMeans_scores() without return types