docstr: Method to initialize the model. Compute similarity matrix based on user (user x user)
docstr_tok: ["Method","to","initialize","the","model",".","Compute","similarity","matrix","based","on","user","(","user","x","user",")"]
code: def init_model(self):
      """
      Method to initialize the model. Compute similarity matrix based on user (user x user)
  
      """
  
      super(UserKNN, self).init_model()
  
      self.users_id_viewed_item = {}
  
      # Set the value for k
      if self.k_neighbors is None:
          self.k_neighbors = int(np.sqrt(len(self.users)))
  
      self.su_matrix = self.compute_similarity(transpose=False)
  
      # Map the users which seen an item with their respective ids
      for item in self.items:
          for user in self.train_set["users_viewed_item"].get(item, []):
              self.users_id_viewed_item.setdefault(item, []).append(
                  self.user_to_user_id[user]
              )
  
file_path: CaseRecommender/caserec/recommenders/rating_prediction/userknn.py
imports: import numpy
  from caserec.utils.extra_functions import timed
  from caserec.recommenders.rating_prediction.base_knn import BaseKNN
label_desc: Use image node_id 2 for calling the UserKNN obj's underlying member method code with example usage: obj.init_model() without return types