docstr: In this implementation, for each unknown item, which will be
  predicted, we first look for its k most similar items and then take the intersection with the seen items of
  the user. Finally, the score of the unknown item will be the sum of the  similarities of k's most similar
  to it, taking into account only the items that each user seen.
docstr_tok: ["In","this","implementation",",","for","each","unknown","item",",","which","will","be","predicted",",","we","first","look","for","its","k","most","similar","items","and","then","take","the","intersection","with","the","seen","items","of","the","user",".","Finally",",","the","score","of","the","unknown","item","will","be","the","sum","of","the","similarities","of","k","'s","most","similar","to","it",",","taking","into","account","only","the","items","that","each","user","seen","."]
code: def predict_similar_first_scores(self, user, user_id):
      """
      In this implementation, for each unknown item, which will be
      predicted, we first look for its k most similar items and then take the intersection with the seen items of
      the user. Finally, the score of the unknown item will be the sum of the  similarities of k's most similar
      to it, taking into account only the items that each user seen.
  
      """
  
      predictions = []
  
      # Selects items that user has not interacted with.
      u_list = list(np.flatnonzero(self.matrix[user_id] == 0))
      seen_items_id = np.flatnonzero(self.matrix[user_id])
  
      # predict score for item_i
      for i_id in u_list:
          # s_id = list(filter(set(self.similar_items[i]).__contains__, seen_items_id))
          s_id = list(
              set(self.similar_items[i_id]).intersection(seen_items_id)
          )
          sim_sum = np.take(self.si_matrix[i_id], s_id)
          predictions.append((user, self.items[i_id], sum(sim_sum)))
  
      return sorted(predictions, key=lambda x: -x[2])[
          : self.rank_length
      ]
  
file_path: CaseRecommender/caserec/recommenders/item_recommendation/itemknn.py
imports: from collections import defaultdict
  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 5 for calling the ItemKNN obj's underlying member method code with example usage: obj.predict_similar_first_scores(user, user_id) and returns: sorted