docstr: This method performs iterations of stochastic gradient ascent over the training data. One iteration is samples
  number of positive entries in the training matrix times, if batch size is 0, else we divide the number of
  positive entries per batch size (see in the init_model).
docstr_tok: ["This","method","performs","iterations","of","stochastic","gradient","ascent","over","the","training","data",".","One","iteration","is","samples","number","of","positive","entries","in","the","training","matrix","times",",","if","batch","size","is","0",",","else","we","divide","the","number","of","positive","entries","per","batch","size","(","see","in","the","init_model",")","."]
code: def fit(self):
      """
      This method performs iterations of stochastic gradient ascent over the training data. One iteration is samples
      number of positive entries in the training matrix times, if batch size is 0, else we divide the number of
      positive entries per batch size (see in the init_model).
  
      """
  
      for n in range(self.epochs):
          random_users = random.choices(
              self.train_set["users"], k=self.num_interactions
          )
          for user in random_users:
              i, j = self.sample_pair(user)
              self.update_factors(
                  self.user_to_user_id[user],
                  self.item_to_item_id[i],
                  self.item_to_item_id[j],
              )
  
file_path: CaseRecommender/caserec/recommenders/item_recommendation/bprmf.py
imports: import random
  import numpy
  from caserec.recommenders.item_recommendation.base_item_recommendation import BaseItemRecommendation
  from caserec.utils.extra_functions import timed
label_desc: Use image node_id 3 for calling the BprMF obj's underlying member method code with example usage: obj.fit() without return types