Calculating Area Under The Precision Recall Curve with multiclass I'm trying to calculate AUPR and when I was doing it on Datasets which were binary in terms of their classes, I used average_precision_score from sklearn and this has approximately solved my problem. However, when I tried to calculate average precision score on a multiclass dataset then its not supported according to sklearn.
Assuming I have to do this manually instead of using some sklearn metric, I'm trying to understand how can I calculate this and I would love some help.
Thanks!

As a side note, there is a multi-class implementation of the average precision in the torchmetrics module that also supports different averaging policies. Note that you would need to convert your numpy ndarrays with ground-truth labels and predictions into torch Tensors via torch.from_numpy() to use this implementation.
