class_docstr: Geodesic Regression.
  
  The generative model of the data is:
  :math:`Z = Exp_{\beta_0}(\beta_1.X)` and :math:`Y = Exp_Z(\epsilon)`
  where:
  
  - :math:`Exp` denotes the Riemannian exponential,
  - :math:`\beta_0` is called the intercept,
    and is a point on the manifold,
  - :math:`\beta_1` is called the coefficient,
    and is a tangent vector to the manifold at :math:`\beta_0`,
  - :math:`\epsilon \sim N(0, 1)` is a standard Gaussian noise,
  - :math:`X` is the input, :math:`Y` is the target.
  
  The geodesic regression method:
  
  - estimates :math:`\beta_0, \beta_1`,
  - predicts :math:`\hat{y}` from input :math:`X`.
  
  Parameters
  ----------
  space : Manifold
      Equipped manifold.
  center_X : bool
      Subtract mean to X as a preprocessing.
  method : str, {\'extrinsic\', \'riemannian\'}
      Gradient descent method.
      Optional, default: extrinsic.
  initialization : str or array-like,
      {'random', 'data', 'frechet', warm_start'}
      Initial values of the parameters for the optimization,
      or initialization method.
      Optional, default: 'random'
  regularization : float
      Weight on the constraint for the intercept to lie on the manifold in
      the extrinsic optimization scheme. An L^2 constraint is applied.
      Optional, default: 1.
  compute_training_score : bool
      Whether to compute R^2.
      Optional, default: False.
  
  Notes
  -----
  * Required metric methods:
      * all: `exp`, `squared_dist`
      * if `riemannian`: `parallel transport` or `to_tangent`
class_docstr_tok: ["Geodesic","Regression",".","The","generative","model","of","the","data","is",":",":","math",":","`","Z","=","Exp_","{","\\beta_0","}","(","\\beta_1.X",")","`","and",":","math",":","`","Y","=","Exp_Z","(","\\epsilon",")","`","where",":","-",":","math",":","`","Exp","`","denotes","the","Riemannian","exponential",",","-",":","math",":","`","\\beta_0","`","is","called","the","intercept",",","and","is","a","point","on","the","manifold",",","-",":","math",":","`","\\beta_1","`","is","called","the","coefficient",",","and","is","a","tangent","vector","to","the","manifold","at",":","math",":","`","\\beta_0","`",",","-",":","math",":","`","\\epsilon","\\sim","N","(","0",",","1",")","`","is","a","standard","Gaussian","noise",",","-",":","math",":","`","X","`","is","the","input",",",":","math",":","`","Y","`","is","the","target",".","The","geodesic","regression","method",":","-","estimates",":","math",":","`","\\beta_0",",","\\beta_1","`",",","-","predicts",":","math",":","`","\\hat","{","y","}","`","from","input",":","math",":","`","X","`",".","Parameters","--","--","--","--","--","space",":","Manifold","Equipped","manifold",".","center_X",":","bool","Subtract","mean","to","X","as","a","preprocessing",".","method",":","str",",","{","\\'extrinsic\\","'",",","\\'riemannian\\","'","}","Gradient","descent","method",".","Optional",",","default",":","extrinsic",".","initialization",":","str","or","array-like",",","{","'random","'",",","'data","'",",","'frechet","'",",","warm_start","'","}","Initial","values","of","the","parameters","for","the","optimization",",","or","initialization","method",".","Optional",",","default",":","'random'","regularization",":","float","Weight","on","the","constraint","for","the","intercept","to","lie","on","the","manifold","in","the","extrinsic","optimization","scheme",".","An","L^2","constraint","is","applied",".","Optional",",","default",":","1.","compute_training_score",":","bool","Whether","to","compute","R^2",".","Optional",",","default",":","False",".","Notes","--","--","-","*","Required","metric","methods",":","*","all",":","`","exp","`",",","`","squared_dist","`","*","if","`","riemannian","`",":","`","parallel","transport","`","or","`","to_tangent","`"]
docstr: Set initial values for the parameters of the model.
  
  Set initial parameters for the optimization, depending on the value
  of the attribute `initialization`. The options are:
  
  - `random` : pick random numbers from a normal distribution,
    then project them to the manifold and the tangent space.
  - `frechet` : compute the Frechet mean of the target points
  - `data` : pick a random sample from the target points and a
    tangent vector with random coefficients.
  - `warm_start`: pick previous values of the parameters if the
    model was fitted before, otherwise behaves as `random`.
  
  Parameters
  ----------
  y: array-like, shape=[n_samples, {dim, [n,n]}]
      The target data, used for the option `data` and 'frechet'.
  
  Returns
  -------
  intercept : array-like, shape=[{dim, [n,n]}]
      Initial value for the intercept.
  coef : array-like, shape=[{dim, [n,n]}]
      Initial value for the coefficient.
docstr_tok: ["Set","initial","values","for","the","parameters","of","the","model",".","Set","initial","parameters","for","the","optimization",",","depending","on","the","value","of","the","attribute","`","initialization","`",".","The","options","are",":","-","`","random","`",":","pick","random","numbers","from","a","normal","distribution",",","then","project","them","to","the","manifold","and","the","tangent","space",".","-","`","frechet","`",":","compute","the","Frechet","mean","of","the","target","points","-","`","data","`",":","pick","a","random","sample","from","the","target","points","and","a","tangent","vector","with","random","coefficients",".","-","`","warm_start","`",":","pick","previous","values","of","the","parameters","if","the","model","was","fitted","before",",","otherwise","behaves","as","`","random","`",".","Parameters","--","--","--","--","--","y",":","array-like",",","shape=","[","n_samples",",","{","dim",",","[","n",",","n","]","}","]","The","target","data",",","used","for","the","option","`","data","`","and","'frechet","'",".","Returns","--","--","--","-","intercept",":","array-like",",","shape=","[","{","dim",",","[","n",",","n","]","}","]","Initial","value","for","the","intercept",".","coef",":","array-like",",","shape=","[","{","dim",",","[","n",",","n","]","}","]","Initial","value","for","the","coefficient","."]
code: def _initialize_parameters(self, y):
      """Set initial values for the parameters of the model.
  
      Set initial parameters for the optimization, depending on the value
      of the attribute `initialization`. The options are:
  
      - `random` : pick random numbers from a normal distribution,
        then project them to the manifold and the tangent space.
      - `frechet` : compute the Frechet mean of the target points
      - `data` : pick a random sample from the target points and a
        tangent vector with random coefficients.
      - `warm_start`: pick previous values of the parameters if the
        model was fitted before, otherwise behaves as `random`.
  
      Parameters
      ----------
      y: array-like, shape=[n_samples, {dim, [n,n]}]
          The target data, used for the option `data` and 'frechet'.
  
      Returns
      -------
      intercept : array-like, shape=[{dim, [n,n]}]
          Initial value for the intercept.
      coef : array-like, shape=[{dim, [n,n]}]
          Initial value for the coefficient.
      """
      init = self.initialization
      shape = self.space.shape
  
      if isinstance(init, str):
          if init == "random":
              return gs.random.normal(size=(2,) + shape)
          if init == "frechet":
              mean = self.mean_estimator.fit(y).estimate_
              return mean, gs.zeros(shape)
          if init == "data":
              return gs.random.choice(y, 1)[0], gs.random.normal(
                  size=shape
              )
          if init == "warm_start":
              if self.intercept_ is not None:
                  return self.intercept_, self.coef_
              return gs.random.normal(size=(2,) + shape)
          raise ValueError(
              "The initialization string must be one of "
              "random, frechet, data or warm_start"
          )
      return init
  
imports: import logging
  import math
  from scipy.optimize import OptimizeResult
  from sklearn.base import BaseEstimator
  import geomstats.backend
  import geomstats.errors
  from geomstats.learning.frechet_mean import FrechetMean
  from geomstats.numerics.optimizers import ScipyMinimize
label_desc: Use image node_id 7 for calling the GeodesicRegression obj's underlying member method code with example usage: obj._initialize_parameters(y) and returns: init, gs, mean,  gs, gs,  gs, gs, self,  self