docstr: This method performs iterations of stochastic gradient ascent over the training data.
docstr_tok: ["This","method","performs","iterations","of","stochastic","gradient","ascent","over","the","training","data","."]
code: def fit(self):
      """
      This method performs iterations of stochastic gradient ascent over the training data.
  
      """
  
      rmse_old = 0.0
  
      for epoch in range(self.epochs):
          error_final = 0.0
  
          for user, item, feedback in self.feedback_triples:
              eui = feedback - self._predict_score(user, item, False)
              error_final += eui**2.0
  
              # Adjust the factors
              u_f = self.p[user]
              i_f = self.q[item]
  
              # Compute factor updates
              delta_u = np.subtract(
                  np.multiply(eui, i_f), np.multiply(self.delta, u_f)
              )
              delta_i = np.subtract(
                  np.multiply(eui, u_f), np.multiply(self.delta, i_f)
              )
  
              # apply updates
              self.p[user] += np.multiply(self.learn_rate, delta_u)
              self.q[item] += np.multiply(self.learn_rate, delta_i)
  
              if self.baseline:
                  self.bu[user] += self.bias_learn_rate * (
                      eui - self.delta_bias * self.bu[user]
                  )
                  self.bi[item] += self.bias_learn_rate * (
                      eui - self.delta_bias * self.bi[item]
                  )
  
          rmse_new = np.sqrt(
              error_final / self.train_set["number_interactions"]
          )
          if np.fabs(rmse_new - rmse_old) <= self.stop_criteria:
              break
          else:
              rmse_old = rmse_new
  
file_path: CaseRecommender/caserec/recommenders/rating_prediction/matrixfactorization.py
imports: import numpy
  from caserec.recommenders.rating_prediction.base_rating_prediction import BaseRatingPrediction
  from caserec.utils.extra_functions import timed
label_desc: Use image node_id 3 for calling the MatrixFactorization obj's underlying member method code with example usage: obj.fit() without return types