class_docstr: ItemKNN is a basic model that compute item similarity with the interaction matrix.
class_docstr_tok: ["ItemKNN","is","a","basic","model","that","compute","item","similarity","with","the","interaction","matrix","."]
code: def predict(self, interaction):
      user = interaction[self.USER_ID]
      item = interaction[self.ITEM_ID]
      user = user.cpu().numpy().astype(int)
      item = item.cpu().numpy().astype(int)
      result = []
  
      for index in range(len(user)):
          uid = user[index]
          iid = item[index]
          score = self.pred_mat[uid, iid]
          result.append(score)
      result = torch.from_numpy(np.array(result)).to(self.device)
      return result
  
file_path: RecBole/recbole/model/general_recommender/itemknn.py
imports: import numpy
  import scipy.sparse
  import torch
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.utils import InputType, ModelType
label_desc: Use image node_id 4 for calling the ItemKNN obj's underlying member method code with example usage: obj.predict(interaction) and returns: result