class_docstr: Class for k-means clustering on manifolds.
  
  K-means algorithm using Riemannian manifolds.
  
  Parameters
  ----------
  space : Manifold
      Equipped manifold.
  n_clusters : int
      Number of clusters (k value of the k-means).
      Optional, default: 8.
  init : str or callable or array-like, shape=[n_clusters, n_features]
      How to initialize cluster centers at the beginning of the algorithm. The
      choice 'random' will select training points as initial cluster centers
      uniformly at random. The choice 'kmeans++' selects cluster centers
      heuristically to improve the convergence rate. When providing an array
      of shape ``(n_clusters, n_features)``, the cluster centers are chosen as the
      rows of that array. When providing a callable, it receives as arguments
      the argument ``X`` to :meth:`fit` and the number of cluster centers
      ``n_clusters`` and is expected to return an array as above.
      Optional, default: 'random'.
  tol : float
      Convergence factor. Convergence is achieved when the difference of mean
      distance between two steps is lower than tol.
      Optional, default: 1e-2.
  max_iter : int
      Maximum number of iterations.
      Optional, default: 100
  verbose : int
      If verbose > 0, information will be printed during learning.
      Optional, default: 0.
  
  Notes
  -----
  * Required metric methods: `dist`.
  
  Example
  -------
  Available example on the Poincaré Ball and Hypersphere manifolds
  :mod:`examples.plot_kmeans_manifolds`
class_docstr_tok: ["Class","for","k-means","clustering","on","manifolds",".","K-means","algorithm","using","Riemannian","manifolds",".","Parameters","--","--","--","--","--","space",":","Manifold","Equipped","manifold",".","n_clusters",":","int","Number","of","clusters","(","k","value","of","the","k-means",")",".","Optional",",","default",":","8.","init",":","str","or","callable","or","array-like",",","shape=","[","n_clusters",",","n_features","]","How","to","initialize","cluster","centers","at","the","beginning","of","the","algorithm",".","The","choice","'random","'","will","select","training","points","as","initial","cluster","centers","uniformly","at","random",".","The","choice","'kmeans++","'","selects","cluster","centers","heuristically","to","improve","the","convergence","rate",".","When","providing","an","array","of","shape","``","(","n_clusters",",","n_features",")","``",",","the","cluster","centers","are","chosen","as","the","rows","of","that","array",".","When","providing","a","callable",",","it","receives","as","arguments","the","argument","``","X","``","to",":","meth",":","`","fit","`","and","the","number","of","cluster","centers","``","n_clusters","``","and","is","expected","to","return","an","array","as","above",".","Optional",",","default",":","'random","'",".","tol",":","float","Convergence","factor",".","Convergence","is","achieved","when","the","difference","of","mean","distance","between","two","steps","is","lower","than","tol",".","Optional",",","default",":","1e-2",".","max_iter",":","int","Maximum","number","of","iterations",".","Optional",",","default",":","100","verbose",":","int","If","verbose",">","0",",","information","will","be","printed","during","learning",".","Optional",",","default",":","0",".","Notes","--","--","-","*","Required","metric","methods",":","`","dist","`",".","Example","--","--","--","-","Available","example","on","the","Poincar\u00e9","Ball","and","Hypersphere","manifolds",":","mod",":","`","examples.plot_kmeans_manifolds","`"]
code: def __init__(
      self,
      space,
      n_clusters=8,
      init="random",
      tol=1e-2,
      max_iter=100,
      verbose=0,
  ):
      self.space = space
  
      self.n_clusters = n_clusters
      self.init = init
      self.tol = tol
      self.verbose = verbose
      self.max_iter = max_iter
  
      self.init_cluster_centers_ = None
  
      self.mean_estimator = FrechetMean(
          space=space,
          method="default",
      ).set(max_iter=100, init_step_size=1.0)
  
      self.cluster_centers_ = None
      self.labels_ = None
      self.inertia_ = None
  
file_path: geomstats/geomstats/learning/kmeans.py
imports: import logging
  from random import randint
  from scipy.stats import rv_discrete
  from sklearn.base import BaseEstimator, ClusterMixin
  import geomstats.backend
  from geomstats.learning._template import TransformerMixin
  from geomstats.learning.frechet_mean import FrechetMean
label_desc: Use image node_id 1 to create a new RiemannianKMeans object from inherited base classes: TransformerMixin, ClusterMixin, BaseEstimator with example: obj = RiemannianKMeans(space, n_clusters, init, tol, max_iter, verbose)