code: def _idcg(hits, k=10):
      sorted_hits = hits[np.argsort(-hits)][: min(len(hits), k)]
      idgc = np.sum(
          (2**sorted_hits - 1)
          / np.log2(np.arange(len(sorted_hits)) + 2)
      )
      return idgc
  
file_path: tensorrec/tensorrec/eval.py
imports: import numpy
  import scipy.sparse
  from .tensorrec import TensorRec
label_desc: Use image node_id 4 for calling a global function with example usage: _idcg(hits, k) and returns: idgc