class_docstr: Test creation of the Kmeans model with various parameter and dataset
  configurations.
docstr: Test that the user can pass hard-coded initial cluster centers, and
  that these are actually used to initialize the clusters.
code: def test_custom_initial_centers(self):
      """
      Test that the user can pass hard-coded initial cluster centers, and
      that these are actually used to initialize the clusters.
      """
  
      ## Empty initial centers
      with self.assertRaises(ValueError):
          m = tc.kmeans.create(
              dataset=self.sf,
              initial_centers=tc.SFrame(),
              max_iterations=self.max_iter,
              verbose=False,
          )
  
      ## Initial centers as an SArray of indices
      with self.assertRaises(TypeError):
          m = tc.kmeans.create(
              dataset=self.sf,
              initial_centers=tc.SArray([1, 2, 3]),
              max_iterations=self.max_iter,
              verbose=False,
          )
  
      ## Initial centers with a schema that doesn't match the data
      sf_init = make_clustering_data(n=10, d=self.dim - 1, seed=43)
  
      with self.assertRaises(ValueError):
          m = tc.kmeans.create(
              dataset=self.sf,
              initial_centers=sf_init,
              max_iterations=self.max_iter,
              verbose=False,
          )
  
      ## Good initial centers
      sf_init = make_clustering_data(n=10, d=self.dim, seed=43)
      ftrs = [
          "float0",
          "float1",
          "dict0",
      ]  # exclude int feature because these *are* changed.
  
      m = tc.kmeans.create(
          self.sf,
          features=ftrs,
          initial_centers=sf_init,
          max_iterations=0,
          verbose=False,
      )
  
      model_init_centers = m.cluster_info
      assert_sframe_equal(sf_init[ftrs], model_init_centers[ftrs])
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import copy
  import numpy
  from numpy.testing import assert_allclose
  import turicreate
  from .None import util
  from turicreate.util import _assert_sframe_equal
  from turicreate.toolkits._main import ToolkitError
  import sys
label_desc: Use image node_id 9 for calling the KmeansCreateTest obj's underlying member method code with example usage: obj.test_custom_initial_centers() without return types