class_docstr: K-means clustering class.
  
  Added in 0.4.1dev
  
  Parameters
  ------------
  k : int
      Number of clusters
  max_iter : int (default: 10)
      Number of iterations during cluster assignment.
      Cluster re-assignment stops automatically when the algorithm
      converged.
  convergence_tolerance : float (default: 1e-05)
      Compares current centroids with centroids of the previous iteration
      using the given tolerance (a small positive float)to determine
      if the algorithm converged early.
  random_seed : int (default: None)
      Set random state for the initial centroid assignment.
  print_progress : int (default: 0)
      Prints progress in fitting to stderr.
      0: No output
      1: Iterations elapsed
      2: 1 plus time elapsed
      3: 2 plus estimated time until completion
  
  Attributes
  -----------
  centroids_ : 2d-array, shape={k, n_features}
      Feature values of the k cluster centroids.
  custers_ : dictionary
      The cluster assignments stored as a Python dictionary;
      the dictionary keys denote the cluster indeces and the items are
      Python lists of the sample indices that were assigned to each
      cluster.
  iterations_ : int
      Number of iterations until convergence.
  
  Examples
  -----------
  For usage examples, please see
  https://rasbt.github.io/mlxtend/user_guide/classifier/Kmeans/
code: def _get_cluster_idx(self, X, centroids):
      for sample_idx, sample in enumerate(X):
          # dist = [euclidean(sample, c) for c in self.centroids_]
          dist = np.sqrt(
              np.sum(np.square(sample - self.centroids_), axis=1)
          )
  
          yield np.argmin(dist)
  
file_path: mlxtend/mlxtend/cluster/kmeans.py
imports: import numpy
  from .._base import _BaseModel, _Cluster, _IterativeModel
label_desc: Use image node_id 3 for calling the Kmeans obj's underlying member method code with example usage: obj._get_cluster_idx(X, centroids) without return types