docstr: Computes the cosine similarity of dataMatrix
  
  If it is computed on :math:`URM=|users| \times |items|`, pass the URM.
  
  If it is computed on :math:`ICM=|items| \times |features|`, pass the ICM transposed.
  
  Args:
      dataMatrix (scipy.sparse.csr_matrix): The sparse data matrix.
      topk (int) : The k value in KNN.
      shrink (int) :  hyper-parameter in calculate cosine distance.
      normalize (bool):   If True divide the dot product by the product of the norms.
docstr_tok: ["Computes","the","cosine","similarity","of","dataMatrix","If","it","is","computed","on",":","math",":","`","URM=|users|","\\times","|items|","`",",","pass","the","URM",".","If","it","is","computed","on",":","math",":","`","ICM=|items|","\\times","|features|","`",",","pass","the","ICM","transposed",".","Args",":","dataMatrix","(","scipy.sparse.csr_matrix",")",":","The","sparse","data","matrix",".","topk","(","int",")",":","The","k","value","in","KNN",".","shrink","(","int",")",":","hyper-parameter","in","calculate","cosine","distance",".","normalize","(","bool",")",":","If","True","divide","the","dot","product","by","the","product","of","the","norms","."]
code: def __init__(self, dataMatrix, topk=100, shrink=0, normalize=True):
      r"""Computes the cosine similarity of dataMatrix
  
      If it is computed on :math:`URM=|users| \times |items|`, pass the URM.
  
      If it is computed on :math:`ICM=|items| \times |features|`, pass the ICM transposed.
  
      Args:
          dataMatrix (scipy.sparse.csr_matrix): The sparse data matrix.
          topk (int) : The k value in KNN.
          shrink (int) :  hyper-parameter in calculate cosine distance.
          normalize (bool):   If True divide the dot product by the product of the norms.
      """
  
      super(ComputeSimilarity, self).__init__()
  
      self.shrink = shrink
      self.normalize = normalize
  
      self.n_rows, self.n_columns = dataMatrix.shape
      self.TopK = min(topk, self.n_columns)
  
      self.dataMatrix = dataMatrix.copy()
  
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 1 to create a new ComputeSimilarity object  with example: obj = ComputeSimilarity(dataMatrix, topk, shrink, normalize)