code: def __batch_evaluate(self, test_events):
          
          percentiles = np.zeros(len(test_events))
  
          all_items = set(self.item_buffer)
          for i, e in enumerate(test_events):
  
              # check if the data allows users to interact the same items repeatedly
              unobserved = all_items
              if not self.repeat:
                  # make recommendation for all unobserved items
                  unobserved -= self.rec.users[e.user.index]['known_items']
                  # true item itself must be in the recommendation candidates
                  unobserved.add(e.item.index)
  
              candidates = np.asarray(list(unobserved))
              recos, scores = self.__recommend(e, candidates)
  
              pos = np.where(recos == e.item.index)[0][0]
              percentiles[i] = pos / (len(recos) - 1) * 100
  
          return np.mean(percentiles)
docs: Evaluate the current model by using the given test events.
  
          Args:
              test_events (list of Event): Current model is evaluated by these events.
  
          Returns:
              float: Mean Percentile Rank for the test set.