from torch import rand, randint from torchmetrics.classification import MultilabelRecallAtFixedPrecision metric = MultilabelRecallAtFixedPrecision(num_labels=3, min_precision=0.5) values = [ ] for _ in range(10): # we index by 0 such that only the maximum recall value is plotted values.append(metric(rand(20, 3), randint(2, (20, 3)))[0]) fig_, ax_ = metric.plot(values)