Torch计算指标-ACC、Recall、Precision、NDCG、HR、ARHR
Calculating Binary Classification Metrics (Accuracy, Recall, Precision, F1, DCG, NDCG, HR, ARHR) for Batched Data using Torch
- Input: pred -> [B, N], true -> [B, N], where [B, N] denotes a two-dimensional array, with B representing BatchSize and N representing the length of the samples.
- Output: Average metrics per batch.
The latter part of the Jupyter notebook will validate the accuracy of the functions.