Skip to content

auc

allennlp.training.metrics.auc

[SOURCE]


Auc

@Metric.register("auc")
class Auc(Metric):
 | def __init__(self, positive_label=1)

The AUC Metric measures the area under the receiver-operating characteristic (ROC) curve for binary classification problems.

__call__

class Auc(Metric):
 | ...
 | def __call__(
 |     self,
 |     predictions: torch.Tensor,
 |     gold_labels: torch.Tensor,
 |     mask: Optional[torch.BoolTensor] = None
 | )

Parameters

  • predictions : torch.Tensor
    A one-dimensional tensor of prediction scores of shape (batch_size).
  • gold_labels : torch.Tensor
    A one-dimensional label tensor of shape (batch_size), with {1, 0} entries for positive and negative class. If it's not binary, positive_label should be passed in the initialization.
  • mask : torch.BoolTensor, optional (default = None)
    A one-dimensional label tensor of shape (batch_size).

get_metric

class Auc(Metric):
 | ...
 | def get_metric(self, reset: bool = False)

reset

class Auc(Metric):
 | ...
 | def reset(self)