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: Select initial medoids when beginning clustering.
docstr_tok: ["Select","initial","medoids","when","beginning","clustering","."]
code: def _initialize_medoids(self, distances):
      """Select initial medoids when beginning clustering."""
      if self.init == "random":
          medoids = gs.random.choice(
              gs.arange(len(distances)), self.n_clusters
          )
      else:
          logging.error("Unknown initialization method.")
  
      return medoids
  
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 2 for calling the RiemannianKMedoids obj's underlying member method code with example usage: obj._initialize_medoids(distances) and returns: medoids