docstr: Method to treat and initialize the model
docstr_tok: ["Method","to","treat","and","initialize","the","model"]
code: def init_model(self):
      """
      Method to treat and initialize the model
  
      """
  
      # Upgrade unobserved items with test set samples
      if self.items_test:
          for u, user in enumerate(self.users):
              self.train_set["items_unobserved"][user] = list(
                  set(self.items)
                  - set(self.train_set["items_seen_by_user"][user])
              )
  
      # Initialize factors
      self.create_factors()
  
      # Define number of interactions in each epoch
      if self.batch_size <= 0:
          self.num_interactions = self.train_set["number_interactions"]
      else:
          self.num_interactions = (
              int(
                  self.train_set["number_interactions"]
                  / self.batch_size
              )
              + 1
          )
  
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 2 for calling the BprMF obj's underlying member method code with example usage: obj.init_model() without return types