code: def _dcg(relevance, k_mask, ror_at_k, ror):
      numer = (2 ** np.multiply(relevance.data, k_mask)) - 1
      denom = np.log2(ror_at_k + 1)
      ror.data = numer / denom  # ranks at 1
      dcg = ror.sum(axis=1).flatten()
  
      return dcg
  
file_path: tensorrec/tensorrec/eval.py
imports: import numpy
  import scipy.sparse
  from .tensorrec import TensorRec
label_desc: Use image node_id 5 for calling a global function with example usage: _dcg(relevance, k_mask, ror_at_k, ror) and returns: dcg