class_docstr: K-means clustering.
  
  :param max_iteration_count: the maximum number of algorithm iterations.
  :type max_iteration_count: int
  
  :param cluster_count: the number of clusters.
  :type cluster_count: int
  
  :param algo: the algorithm used during clustering.
  :type algo: str, {'elkan', 'lloyd'}, default='lloyd'
  
  :param init: the algorithm used for selecting initial centers.
  :type init: str, {'k++', 'default'}, default='default'
  
  :param distance: the distance function.
  :type distance: str, {'euclid', 'machalanobis', 'cosine'}, default='euclid'
  
  :param thread_count: number of threads
  :type thread_count: int, > 0, default=1
  
  :param run_count: number of runs, the result is the best of the runs (based on inertia)
  :type run_count: int, > 0, default=1
  
  :param seed: the initial seed for random
  :type seed: int, default=3306
class_docstr_tok: ["K-means","clustering",".",":","param","max_iteration_count",":","the","maximum","number","of","algorithm","iterations",".",":","type","max_iteration_count",":","int",":","param","cluster_count",":","the","number","of","clusters",".",":","type","cluster_count",":","int",":","param","algo",":","the","algorithm","used","during","clustering",".",":","type","algo",":","str",",","{","'elkan","'",",","'lloyd","'","}",",","default='lloyd'",":","param","init",":","the","algorithm","used","for","selecting","initial","centers",".",":","type","init",":","str",",","{","'","k++","'",",","'default","'","}",",","default='default'",":","param","distance",":","the","distance","function",".",":","type","distance",":","str",",","{","'euclid","'",",","'machalanobis","'",",","'cosine","'","}",",","default='euclid'",":","param","thread_count",":","number","of","threads",":","type","thread_count",":","int",",",">","0",",","default=1",":","param","run_count",":","number","of","runs",",","the","result","is","the","best","of","the","runs","(","based","on","inertia",")",":","type","run_count",":","int",",",">","0",",","default=1",":","param","seed",":","the","initial","seed","for","random",":","type","seed",":","int",",","default=3306"]
code: def __init__(
      self,
      max_iteration_count,
      cluster_count,
      algo="lloyd",
      init="default",
      distance="euclid",
      thread_count=1,
      run_count=1,
      seed=3306,
  ):
      if algo != "elkan" and algo != "lloyd":
          raise ValueError(
              "The `algo` must be one of {`elkan`, `lloyd`}."
          )
      if init != "k++" and init != "default":
          raise ValueError(
              "The `init` must be one of {`k++`, `default`}."
          )
      if (
          distance != "euclid"
          and distance != "machalanobis"
          and distance != "cosine"
      ):
          raise ValueError(
              "The `distance` must be one of {`euclid`, `machalanobis`, `cosine`}."
          )
      if max_iteration_count <= 0:
          raise ValueError("The `max_iteration_count` must be > 0.")
      if cluster_count <= 0:
          raise ValueError("The `cluster_count` must be > 0.")
      if thread_count <= 0:
          raise ValueError("The `thread_count` must be > 0")
      if run_count <= 0:
          raise ValueError("The `run_count` must be > 0")
      if not isinstance(seed, int):
          raise ValueError("The `seed` must be integer")
      super().__init__(
          algo,
          init,
          distance,
          int(max_iteration_count),
          int(cluster_count),
          int(thread_count),
          int(run_count),
          int(seed),
      )
  
file_path: neoml/NeoML/Python/neoml/Clustering.py
imports: import numpy
  from .Utils import convert_data, get_data
  from scipy.sparse import csr_matrix
  import neoml.PythonWrapper
label_desc: Use image node_id 1 to create a new KMeans object from inherited base classes: PythonWrapper with example: obj = KMeans(max_iteration_count, cluster_count, algo, init, distance, thread_count, run_count, seed)