class_docstr: Lift data to a tangent space.
  
  Compute the logs of all data points and reshape them to
  1d vectors if necessary. This means that all the data points, that belong
  to a possibly non-linear manifold are lifted to one of the tangent space of
  the manifold, which is a vector space. By default, the mean of the data
  is computed (with the FrechetMean or the ExponentialBarycenter estimator,
  as appropriate) and the tangent space at the mean is used. Any other base
  point can be passed. The data points are then represented by the initial
  velocities of the geodesics that lead from base_point to each data point.
  Any machine learning algorithm can then be used with the output array.
  
  Parameters
  ----------
  space : Manifold
      Equipped manifold or unequipped space implementing `exp` and `log`.
  
  Notes
  -----
  * Required geometry methods: `log`, `exp`.
class_docstr_tok: ["Lift","data","to","a","tangent","space",".","Compute","the","logs","of","all","data","points","and","reshape","them","to","1d","vectors","if","necessary",".","This","means","that","all","the","data","points",",","that","belong","to","a","possibly","non-linear","manifold","are","lifted","to","one","of","the","tangent","space","of","the","manifold",",","which","is","a","vector","space",".","By","default",",","the","mean","of","the","data","is","computed","(","with","the","FrechetMean","or","the","ExponentialBarycenter","estimator",",","as","appropriate",")","and","the","tangent","space","at","the","mean","is","used",".","Any","other","base","point","can","be","passed",".","The","data","points","are","then","represented","by","the","initial","velocities","of","the","geodesics","that","lead","from","base_point","to","each","data","point",".","Any","machine","learning","algorithm","can","then","be","used","with","the","output","array",".","Parameters","--","--","--","--","--","space",":","Manifold","Equipped","manifold","or","unequipped","space","implementing","`","exp","`","and","`","log","`",".","Notes","--","--","-","*","Required","geometry","methods",":","`","log","`",",","`","exp","`","."]
docstr: Lift data to a tangent space.
  
  Compute the logs of all data point and reshapes them to
  1d vectors if necessary. By default the logs are taken at the mean
  but any other base point can be passed. Any machine learning
  algorithm can then be used with the output array.
  
  Parameters
  ----------
  X : array-like, shape=[n_samples, {dim, [n, n]}]
      Data to transform.
  
  Returns
  -------
  X_new : array-like, shape=[n_samples, dim]
      Lifted data.
docstr_tok: ["Lift","data","to","a","tangent","space",".","Compute","the","logs","of","all","data","point","and","reshapes","them","to","1d","vectors","if","necessary",".","By","default","the","logs","are","taken","at","the","mean","but","any","other","base","point","can","be","passed",".","Any","machine","learning","algorithm","can","then","be","used","with","the","output","array",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape=","[","n_samples",",","{","dim",",","[","n",",","n","]","}","]","Data","to","transform",".","Returns","--","--","--","-","X_new",":","array-like",",","shape=","[","n_samples",",","dim","]","Lifted","data","."]
code: def transform(self, X):
      """Lift data to a tangent space.
  
      Compute the logs of all data point and reshapes them to
      1d vectors if necessary. By default the logs are taken at the mean
      but any other base point can be passed. Any machine learning
      algorithm can then be used with the output array.
  
      Parameters
      ----------
      X : array-like, shape=[n_samples, {dim, [n, n]}]
          Data to transform.
  
      Returns
      -------
      X_new : array-like, shape=[n_samples, dim]
          Lifted data.
      """
      if self.base_point_ is None:
          raise Exception("Not fitted")
  
      tangent_vecs = self._geometry.log(X, base_point=self.base_point_)
  
      if self.space.point_ndim == 1:
          return tangent_vecs
  
      if gs.all(Matrices.is_symmetric(tangent_vecs)):
          X = SymmetricMatrices.basis_representation(tangent_vecs)
  
      elif gs.all(Matrices.is_skew_symmetric(tangent_vecs)):
          X = SkewSymmetricMatrices(
              tangent_vecs.shape[-1]
          ).basis_representation(tangent_vecs)
      else:
          X = gs.reshape(tangent_vecs, (len(X), -1))
  
      return X
  
file_path: geomstats/geomstats/learning/preprocessing.py
imports: from sklearn.base import BaseEstimator, TransformerMixin
  import geomstats.backend
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.skew_symmetric_matrices import SkewSymmetricMatrices
  from geomstats.geometry.symmetric_matrices import SymmetricMatrices
  from geomstats.learning.exponential_barycenter import ExponentialBarycenter
  from geomstats.learning.frechet_mean import FrechetMean
label_desc: Use image node_id 4 for calling the ToTangentSpace obj's underlying member method code with example usage: obj.transform(X) and returns: X, tangent_vecs