class_docstr: Learner for a Robust Generalized Linear Model (GML).
  This is a GLM with sample intercepts (one for each sample).
  Slope penalization is used on the individual intercepts.
  Not intended for end-users, but for development only.
  It should be sklearn-learn compliant.
  
  Parameters
  ----------
  C_sample_intercepts : `float`
      Level of penalization of the ProxSlope penalization used for detection
      of outliers. Ideally, this should be equal to n_samples / noise_level,
      where noise_level is an estimated noise level
  
  C : `float`, default=1e3
      Level of penalization of the model weights
  
  fdr : `float`, default=0.05
      Target false discovery rate for the detection of outliers, namely for
      the detection of non-zero entries in ``sample_intercepts``
  
  penalty : {'none', 'l1', 'l2', 'elasticnet', 'slope'}, default='l2'
      The penalization to use. Default 'l2', namely ridge penalization.
  
  fit_intercept : `bool`, default=True
      If `True`, include an intercept in the model, namely a global intercept
  
  refit : 'bool', default=False
      Not implemented yet
  
  solver : 'gd', 'agd'
      The name of the solver to use. For now, only gradient descent and
      accelerated gradient descent are available
  
  warm_start : `bool`, default=False
      If true, learning will start from the last reached solution
  
  step : `float`, default=None
      Initial step size used for learning.
  
  tol : `float`, default=1e-7
      The tolerance of the solver (iterations stop when the stopping
      criterion is below it).
  
  max_iter : `int`, default=100
      Maximum number of iterations of the solver
  
  verbose : `bool`, default=True
      If `True`, we verbose things, otherwise the solver does not
      print anything (but records information in history anyway)
  
  print_every : `int`, default=10
      Print history information when ``n_iter`` (iteration number) is
      a multiple of ``print_every``
  
  record_every : `int`, default=10
      Record history information when ``n_iter`` (iteration number) is
      a multiple of ``record_every``
      
  Other Parameters
  ----------------
  elastic_net_ratio : `float`, default=0.95
      Ratio of elastic net mixing parameter with 0 <= ratio <= 1.
      For ratio = 0 this is ridge (L2 squared) regularization
      For ratio = 1 this is lasso (L1) regularization
      For 0 < ratio < 1, the regularization is a linear combination
      of L1 and L2.
      Used in 'elasticnet' penalty only.
  
  slope_fdr : `float`, default=0.05
      Target false discovery rate for the detection of detection of non-zero
      entries in the model weights.
      Used in the 'slope' penalty only.
  
  Attributes
  ----------
  weights : `numpy.array`, shape=(n_features,)
      The learned weights of the model (not including the intercept)
  
  sample_intercepts : `numpy.array`, shape=(n_samples,)
      Sample intercepts. This should be a sparse vector, since a non-zero
      entry means that the sample is an outlier.
  
  intercept : `float` or `None`
      The intercept, if ``fit_intercept=True``, otherwise `None`
  
  coeffs : `numpy.array`, shape=(n_features + n_samples + 1,)
      The full array of coefficients of the model. Namely, this is simply
      the concatenation of ``weights``, ``sample_intercepts``
      and ``intercept``
docstr: Fit the model according to the given training data.
  
  Parameters
  ----------
  X : `np.ndarray` or `scipy.sparse.csr_matrix`,, shape=(n_samples, n_features)
      Training vector, where n_samples in the number of samples and
      n_features is the number of features.
  
  y : `np.array`, shape=(n_samples,)
      Target vector relative to X.
  
  Returns
  -------
  self : LearnerGLM
      The fitted instance of the model
docstr_tok: ["Fit","the","model","according","to","the","given","training","data",".","Parameters","--","--","--","--","--","X",":","`","np.ndarray","`","or","`","scipy.sparse.csr_matrix","`",",",",","shape=","(","n_samples",",","n_features",")","Training","vector",",","where","n_samples","in","the","number","of","samples","and","n_features","is","the","number","of","features",".","y",":","`","np.array","`",",","shape=","(","n_samples",",",")","Target","vector","relative","to","X",".","Returns","--","--","--","-","self",":","LearnerGLM","The","fitted","instance","of","the","model"]
code: def fit(self, X: object, y: np.array):
      """Fit the model according to the given training data.
  
      Parameters
      ----------
      X : `np.ndarray` or `scipy.sparse.csr_matrix`,, shape=(n_samples, n_features)
          Training vector, where n_samples in the number of samples and
          n_features is the number of features.
  
      y : `np.array`, shape=(n_samples,)
          Target vector relative to X.
  
      Returns
      -------
      self : LearnerGLM
          The fitted instance of the model
      """
      solver_obj = self._solver_obj
      model_obj = self._model_obj
      prox_obj = self._prox_obj
      prox_intercepts_obj = self._prox_intercepts_obj
      fit_intercept = self.fit_intercept
  
      X = LearnerGLM._safe_array(X)
      y = LearnerGLM._safe_array(y)
  
      # Pass the data to the model
      model_obj.fit(X, y)
  
      n_samples = model_obj.n_samples
      n_features = model_obj.n_features
  
      if self.step is None:
          self.step = 1.0 / model_obj.get_lip_best()
  
      # Range of the sample intercepts prox is always the same
      if fit_intercept:
          prox_intercepts_obj.range = (
              n_features + 1,
              n_features + n_samples + 1,
          )
      else:
          prox_intercepts_obj.range = (
              n_features,
              n_features + n_samples,
          )
      prox_obj.range = (0, n_features)
  
      if self.penalty == "none":
          # No penalization is used on the model weights, so the prox applied
          # overall is only ProxSlope on the sample intercepts
          solver_prox = prox_intercepts_obj
      else:
          solver_prox = ProxMulti([prox_obj, prox_intercepts_obj])
  
      # Now, we can pass the model and prox objects to the solver
      solver_obj.set_model(model_obj).set_prox(solver_prox)
      # Make sure that there is no linesearch
      solver_obj.linesearch = False
  
      coeffs_start = None
      if self.warm_start and self.coeffs is not None:
          if self.coeffs.shape == (model_obj.n_coeffs,):
              coeffs_start = self.coeffs
          else:
              raise ValueError(
                  "Cannot warm start, coeffs don't have the "
                  "right shape"
              )
  
      # Launch the solver
      coeffs = solver_obj.solve(coeffs_start)
  
      self._set("coeffs", coeffs)
      self._set("weights", coeffs[:n_features])
      if fit_intercept:
          self._set("intercept", coeffs[n_features])
          self._set(
              "sample_intercepts",
              coeffs[(n_features + 1) : (n_features + n_samples + 1)],
          )
      else:
          self._set("intercept", None)
          self._set(
              "sample_intercepts",
              coeffs[n_features : (n_features + n_samples)],
          )
      self._set("_fitted", True)
      return self
  
imports: from warnings import warn
  import numpy
  from tick.base import Base
  from tick.base.learner import LearnerGLM
  from tick.prox import ProxZero, ProxL1, ProxL2Sq, ProxElasticNet, ProxSlope, ProxMulti
label_desc: Use image node_id 2 for calling the LearnerRobustGLM obj's underlying member method code with example usage: obj.fit(X, y) and returns: self