docstr: This method predict final result, building an rank of each user of the train set.
docstr_tok: ["This","method","predict","final","result",",","building","an","rank","of","each","user","of","the","train","set","."]
code: def predict(self):
      """
      This method predict final result, building an rank of each user of the train set.
  
      """
  
      if self.test_file is not None:
          for user in self.test_set["users"]:
              for item in self.test_set["feedback"][user]:
                  count_value = 0
                  feedback_value = 0
  
                  for user_v in self.train_set["users_viewed_item"].get(
                      item, []
                  ):
                      feedback_value += self.train_set["feedback"][
                          user_v
                      ][item]
                      count_value += 1
  
                  if feedback_value == 0:
                      try:
                          feedback_value = np.mean(
                              list(
                                  self.train_set["feedback"][
                                      user
                                  ].values()
                              )
                          )
                      except KeyError:
                          feedback_value = self.train_set["mean_value"]
                  else:
                      feedback_value /= count_value
  
                  self.predictions.append((user, item, feedback_value))
      else:
          raise NotImplemented
  
file_path: CaseRecommender/caserec/recommenders/rating_prediction/most_popular.py
imports: from caserec.recommenders.rating_prediction.base_rating_prediction import BaseRatingPrediction
  from caserec.utils.extra_functions import timed
  import numpy
label_desc: Use image node_id 2 for calling the MostPopular obj's underlying member method code with example usage: obj.predict() without return types