Torch计算指标-ACC、Recall、Precision、NDCG、HR、ARHR

发布时间 2023-08-23 20:26:41作者: pipe_dream

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.