RecallMetric<T>

Models & Types · AiDotNet.Evaluation.Metrics.Classification

Computes recall (sensitivity, true positive rate): the proportion of actual positives correctly identified.

Implements: IClassificationMetric<T>

For Beginners

Recall answers: “Of all actual positives, how many did the model find?” High recall means few false negatives (missed positives). A cancer screening test with 99% recall means it catches 99% of actual cancer cases.

How It Works

Recall = TP / (TP + FN) = True Positives / Actual Positives

When to prioritize recall:

  • When false negatives are costly (missing disease, missing fraud)
  • When you must catch as many positives as possible

Trade-off: Improving recall often decreases precision, and vice versa. F1-score balances both, and you can use F-beta to weight one more than the other.

Constructors

Constructor Summary
RecallMetric(AveragingMethod averaging) Initializes a new recall metric with default positive label (1).
RecallMetric(T positiveLabel, AveragingMethod averaging) Initializes a new recall metric with an explicit positive label.

Properties

Property Summary
MetricDirection Direction { get; }
T MaxValue { get; }
T MinValue { get; }
bool RequiresProbabilities { get; }
bool SupportsMultiClass { get; }
string Category { get; }
string Description { get; }
string Name { get; }

Methods

Method Summary
MetricWithCI<T> ComputeWithCI(ReadOnlySpan<T> predictions, ReadOnlySpan<T> actuals, ConfidenceIntervalMethod ciMethod, double confidenceLevel, int bootstrapSamples, int? randomSeed)
T Compute(ReadOnlySpan<T> predictions, ReadOnlySpan<T> actuals)