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:
              pu = self.p[user] + self.y_sum_rows(user)
              pi = self.q[item] + self.x_sum_rows(item)
  
              learn_rate1 = self.bias_learn_rate
              learn_rate2 = self.learn_rate
              delta1 = 0.05 * self.n_u[user]
              delta2 = 0.05 * self.n_i[item]
              delta3 = self.n_u[user]
              delta4 = self.n_i[item]
  
              # Calculate error
              eui = feedback - self._predict_gsvd(
                  user, item, pu, pi, False
              )
              error_final += eui**2.0
  
              # update bu and bi
              self.bu[user] += learn_rate1 * (
                  eui - delta1 * self.bu[user]
              )
              self.bi[item] += learn_rate2 * (
                  eui - delta2 * self.bi[item]
              )
  
              part_2_user = np.multiply(eui, pi) - np.multiply(
                  delta3, self.p[user]
              )
              self.p[user] = self.p[user] + learn_rate2 * part_2_user
  
              part_2_item = np.multiply(eui, pu) - np.multiply(
                  delta4, self.q[item]
              )
              self.q[item] = self.q[item] + learn_rate2 * part_2_item
  
              for _g in self.meta_dict_item_category[
                  self.item_id_to_item[item]
              ]:
                  g = self.g_to_gid[_g]
                  delta5 = 1 / self.meta_dict_category[_g]
                  part_2 = (
                      eui * self.n_g[item] * pu - delta5 * self.x[g]
                  )
                  self.x[g] = self.x[g] + learn_rate2 * part_2
  
              for j in self.items_id_seen_by_user[user]:
                  delta6 = self.n_i[j]
                  part_2 = (
                      eui * self.n_u[user] * pi - delta6 * self.y[j]
                  )
                  self.y[j] = self.y[j] + learn_rate2 * part_2
  
          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/gsvdplusplus.py
imports: import numpy
  from caserec.recommenders.rating_prediction.matrixfactorization import MatrixFactorization
  from caserec.utils.process_data import ReadFile
label_desc: Use image node_id 3 for calling the GSVDPlusPlus obj's underlying member method code with example usage: obj.fit() without return types