class_docstr: Class for Riemannian Mean Shift algorithm on manifolds.
  
  Mean Shift is a procedure for locating the maxima - the modes of a
  density function given discrete data sampled from that function. It is
  an iterative method for finding the centers of a collection of clusters.
  
  Following implementation assumes a flat kernel method.
  
  Parameters
  ----------
  space : Manifold
      Equipped manifold.
  bandwidth : float
      Size of neighbourhood around each center. All points in 'bandwidth'
      size around center are considered for calculating new mean centers.
  tol : float
      Stopping condition. Computation of subsequent mean centers is stopped
      when the distance between them is less than 'tol'.
      Optional, default : 1e-2.
  n_clusters : int
      Number of centers.
      Optional, default : 1.
  n_jobs : int
      Number of parallel threads to be initiated for parallel jobs.
      Optional, default : 1.
  max_iter : int
      Upper bound on total number of iterations for the centers to converge.
      Optional, default : 100.
  init_centers : str
      Initializing centers, either from the given input points or
      random points uniformly distributed in the input manifold.
      Optional, default : "from_points".
  kernel : str
      Weighing function to assign kernel weights to each center.
      Optional, default : "flat".
  
  Notes
  -----
  * Required metric methods: `dist`, `closest_neighbor_index`.
class_docstr_tok: ["Class","for","Riemannian","Mean","Shift","algorithm","on","manifolds",".","Mean","Shift","is","a","procedure","for","locating","the","maxima","-","the","modes","of","a","density","function","given","discrete","data","sampled","from","that","function",".","It","is","an","iterative","method","for","finding","the","centers","of","a","collection","of","clusters",".","Following","implementation","assumes","a","flat","kernel","method",".","Parameters","--","--","--","--","--","space",":","Manifold","Equipped","manifold",".","bandwidth",":","float","Size","of","neighbourhood","around","each","center",".","All","points","in","'bandwidth'","size","around","center","are","considered","for","calculating","new","mean","centers",".","tol",":","float","Stopping","condition",".","Computation","of","subsequent","mean","centers","is","stopped","when","the","distance","between","them","is","less","than","'tol","'",".","Optional",",","default",":","1e-2",".","n_clusters",":","int","Number","of","centers",".","Optional",",","default",":","1.","n_jobs",":","int","Number","of","parallel","threads","to","be","initiated","for","parallel","jobs",".","Optional",",","default",":","1.","max_iter",":","int","Upper","bound","on","total","number","of","iterations","for","the","centers","to","converge",".","Optional",",","default",":","100.","init_centers",":","str","Initializing","centers",",","either","from","the","given","input","points","or","random","points","uniformly","distributed","in","the","input","manifold",".","Optional",",","default",":","``","from_points","''",".","kernel",":","str","Weighing","function","to","assign","kernel","weights","to","each","center",".","Optional",",","default",":","``","flat","''",".","Notes","--","--","-","*","Required","metric","methods",":","`","dist","`",",","`","closest_neighbor_index","`","."]
docstr: Predict the closest cluster each point in `points` belongs to.
  
  Parameters
  ----------
  points : array-like, shape=[n_samples, n_features]
      Clusters of points.
docstr_tok: ["Predict","the","closest","cluster","each","point","in","`","points","`","belongs","to",".","Parameters","--","--","--","--","--","points",":","array-like",",","shape=","[","n_samples",",","n_features","]","Clusters","of","points","."]
code: def predict(self, X):
      """Predict the closest cluster each point in `points` belongs to.
  
      Parameters
      ----------
      points : array-like, shape=[n_samples, n_features]
          Clusters of points.
      """
      if self.cluster_centers_ is None:
          raise Exception("Not fitted")
  
      return self.space.metric.closest_neighbor_index(
          X, self.cluster_centers_
      )
  
file_path: geomstats/geomstats/learning/riemannian_mean_shift.py
imports: import joblib
  from sklearn.base import BaseEstimator, ClusterMixin
  import geomstats.backend
  from geomstats.learning.frechet_mean import FrechetMean
label_desc: Use image node_id 5 for calling the RiemannianMeanShift obj's underlying member method code with example usage: obj.predict(X) and returns: self