RecallMetric#
- class brainstate.nn.RecallMetric(num_classes=None, average='macro')#
Recall (sensitivity) metric for binary and multi-class classification.
Recall is the ratio of true positives to all actual positives: recall = TP / (TP + FN)
- Parameters:
- true_positives#
Count of true positive predictions.
- Type:
- false_negatives#
Count of false negative predictions.
- Type:
Examples
>>> import jax.numpy as jnp >>> import brainstate >>> predictions = jnp.array([1, 0, 1, 1, 0]) >>> labels = jnp.array([1, 0, 0, 1, 0]) >>> metric = brainstate.nn.RecallMetric() >>> metric.update(predictions=predictions, labels=labels) >>> metric.compute() Array(1., dtype=float32)
Notes
Recall measures the fraction of actual positive cases that were correctly identified. Also known as sensitivity or true positive rate (TPR).