class_docstr: RLRMC algorithm implementation.
class_docstr_tok: ["RLRMC","algorithm","implementation","."]
docstr: The underlying fit method for RLRMC
  
  Args:
      RLRMCdata (RLRMCdataset): the RLRMCdataset object.
      verbosity (int): verbosity of Pymanopt. Possible values are 0 (least verbose), 1, or 2 (most verbose).
      _evaluate (bool): flag to compute the per iteration statistics in train (and validation) datasets.
docstr_tok: ["The","underlying","fit","method","for","RLRMC","Args",":","RLRMCdata","(","RLRMCdataset",")",":","the","RLRMCdataset","object",".","verbosity","(","int",")",":","verbosity","of","Pymanopt",".","Possible","values","are","0","(","least","verbose",")",",","1",",","or","2","(","most","verbose",")",".","_evaluate","(","bool",")",":","flag","to","compute","the","per","iteration","statistics","in","train","(","and","validation",")","datasets","."]
code: def fit(self, RLRMCdata, verbosity=0, _evaluate=False):
      """The underlying fit method for RLRMC
  
      Args:
          RLRMCdata (RLRMCdataset): the RLRMCdataset object.
          verbosity (int): verbosity of Pymanopt. Possible values are 0 (least verbose), 1, or 2 (most verbose).
          _evaluate (bool): flag to compute the per iteration statistics in train (and validation) datasets.
      """
      # initialize the model
      W0 = self._init_train(RLRMCdata.train)
      self.user2id = RLRMCdata.user2id
      self.item2id = RLRMCdata.item2id
      self.id2user = RLRMCdata.id2user
      self.id2item = RLRMCdata.id2item
  
      # residual variable
      residual_global = np.zeros(
          RLRMCdata.train.data.shape, dtype=np.float64
      )
  
      ####################################
      # Riemannian first-order algorithm #
      ####################################
  
      solver = ConjugateGradientMS(
          maxtime=self.max_time,
          maxiter=self.maxiter,
          linesearch=LineSearchBackTracking(),
      )  # , logverbosity=2)
      # construction of manifold
      manifold = Product(
          [
              Stiefel(self.model_param.get("num_row"), self.rank),
              Stiefel(self.model_param.get("num_col"), self.rank),
              SymmetricPositiveDefinite(self.rank),
          ]
      )
      problem = Problem(
          manifold=manifold,
          cost=lambda x: self._cost(
              x,
              RLRMCdata.train.data,
              RLRMCdata.train.indices,
              RLRMCdata.train.indptr,
              residual_global,
          ),
          egrad=lambda z: self._egrad(
              z,
              RLRMCdata.train.indices,
              RLRMCdata.train.indptr,
              residual_global,
          ),
          verbosity=verbosity,
      )
  
      if _evaluate:
          residual_validation_global = np.zeros(
              RLRMCdata.validation.data.shape, dtype=np.float64
          )
          Wopt, self.stats = solver.solve(
              problem,
              x=W0,
              compute_stats=lambda x, y, z: self._my_stats(
                  x,
                  y,
                  z,
                  residual_global,
                  RLRMCdata.validation.data,
                  RLRMCdata.validation.indices,
                  RLRMCdata.validation.indptr,
                  residual_validation_global,
              ),
          )
      else:
          Wopt, self.stats = solver.solve(problem, x=W0)
      self.L = np.dot(Wopt[0], Wopt[2])
      self.R = Wopt[1]
  
imports: import numpy
  import logging
  from pymanopt import Problem
  from recommenders.models.rlrmc.conjugate_gradient_ms import ConjugateGradientMS
  from pymanopt.solvers.linesearch import LineSearchBackTracking
  from pymanopt.manifolds import Stiefel, SymmetricPositiveDefinite, Product
  from math import sqrt
  from scipy.sparse import csr_matrix
  from scipy.sparse.linalg import svds
  from numba import njit, prange
label_desc: Use image node_id 4 for calling the RLRMCalgorithm obj's underlying member method code with example usage: obj.fit(RLRMCdata, verbosity, _evaluate) without return types