class_docstr: Class for K-medoids clustering on manifolds.
  
  K-medoids algorithm using Riemannian manifolds.
  
  Parameters
  ----------
  space : Manifold
      Equipped manifold.
  n_clusters : int
      Number of clusters (k value of k-medoids).
      Optional, default: 8.
  max_iter : int
      Maximum number of iterations.
      Optional, default: 100.
  init : str
      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.
      Optional, default: 'random'.
  n_jobs : int
      Number of jobs to run in parallel. `-1` means using all processors.
      Optional, default: 1.
  
  Notes
  -----
  * Required metric methods: `dist`, `dist_pairwise`.
  
  Example
  -------
  Available example on the Poincaré Ball and Hypersphere manifolds
  :mod:`examples.plot_kmedoids_manifolds`
class_docstr_tok: ["Class","for","K-medoids","clustering","on","manifolds",".","K-medoids","algorithm","using","Riemannian","manifolds",".","Parameters","--","--","--","--","--","space",":","Manifold","Equipped","manifold",".","n_clusters",":","int","Number","of","clusters","(","k","value","of","k-medoids",")",".","Optional",",","default",":","8.","max_iter",":","int","Maximum","number","of","iterations",".","Optional",",","default",":","100.","init",":","str","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",".","Optional",",","default",":","'random","'",".","n_jobs",":","int","Number","of","jobs","to","run","in","parallel",".","`","-1","`","means","using","all","processors",".","Optional",",","default",":","1",".","Notes","--","--","-","*","Required","metric","methods",":","`","dist","`",",","`","dist_pairwise","`",".","Example","--","--","--","-","Available","example","on","the","Poincar\u00e9","Ball","and","Hypersphere","manifolds",":","mod",":","`","examples.plot_kmedoids_manifolds","`"]
docstr: Predict the closest cluster for each sample in X.
  
  Parameters
  ----------
  X : array-like, shape=[n_samples, dim,]
      Training data, where n_samples is the number of samples and
      dim is the number of dimensions.
  
  Returns
  -------
  labels : array-like, shape=[n_samples,]
      Index of the cluster each sample belongs to.
docstr_tok: ["Predict","the","closest","cluster","for","each","sample","in","X.","Parameters","--","--","--","--","--","X",":","array-like",",","shape=","[","n_samples",",","dim",",","]","Training","data",",","where","n_samples","is","the","number","of","samples","and","dim","is","the","number","of","dimensions",".","Returns","--","--","--","-","labels",":","array-like",",","shape=","[","n_samples",",","]","Index","of","the","cluster","each","sample","belongs","to","."]
code: def predict(self, X):
      """Predict the closest cluster for each sample in X.
  
      Parameters
      ----------
      X : array-like, shape=[n_samples, dim,]
          Training data, where n_samples is the number of samples and
          dim is the number of dimensions.
  
      Returns
      -------
      labels : array-like, shape=[n_samples,]
          Index of the cluster each sample belongs to.
      """
      labels = gs.zeros(len(X))
  
      for point_index, point_value in enumerate(X):
          distances = gs.zeros(len(self.cluster_centers_))
          for cluster_index, cluster_value in enumerate(
              self.cluster_centers_
          ):
              distances[cluster_index] = self.space.metric.dist(
                  point_value, cluster_value
              )
  
          labels[point_index] = gs.argmin(distances)
  
      return labels
  
file_path: geomstats/geomstats/learning/kmedoids.py
imports: import logging
  from sklearn.base import BaseEstimator, ClusterMixin
  import geomstats.backend
  from geomstats.learning._template import TransformerMixin
label_desc: Use image node_id 5 for calling the RiemannianKMedoids obj's underlying member method code with example usage: obj.predict(X) and returns: labels