docstr: Method to treat and initialize the model. . Extends init_model from MatrixFactorization
docstr_tok: ["Method","to","treat","and","initialize","the","model",".",".","Extends","init_model","from","MatrixFactorization"]
code: def init_model(self):
      """
      Method to treat and initialize the model. . Extends init_model from MatrixFactorization
  
      """
  
      super(GSVDPlusPlus, self).init_model()
  
      self.n_u = {}
      self.items_id_seen_by_user = {}
      self.users_id_seen_by_item = {}
  
      for user in self.train_set["users"]:
          for item in self.train_set["items_seen_by_user"][user]:
              self.items_id_seen_by_user.setdefault(
                  self.user_to_user_id[user], []
              ).append(self.item_to_item_id[item])
              self.users_id_seen_by_item.setdefault(
                  self.item_to_item_id[item], []
              ).append(self.user_to_user_id[user])
          # |N(u)|^(-1/2)
          self.n_u[self.user_to_user_id[user]] = np.sqrt(
              len(self.train_set["items_seen_by_user"][user])
          )
  
      self.n_i = {}
      self.n_g = {}
      for item in self.items:
          if item in self.meta_dict_item_category:
              self.n_g[self.item_to_item_id[item]] = 1 / len(
                  self.meta_dict_item_category[item]
              )
          else:
              self.n_g[self.item_to_item_id[item]] = 0
  
          if item in self.train_set["items"]:
              self.n_i[self.item_to_item_id[item]] = np.sqrt(
                  len(
                      self.users_id_seen_by_item[
                          self.item_to_item_id[item]
                      ]
                  )
              )
          else:
              self.n_i[self.item_to_item_id[item]] = 0
  
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 2 for calling the GSVDPlusPlus obj's underlying member method code with example usage: obj.init_model() without return types