AUCPRMetric<T>

Models & Types · AiDotNet.Evaluation.Metrics.Classification

Computes Area Under the Precision-Recall Curve (AUC-PR).

Implements: IClassificationMetric<T>

For Beginners

AUC-PR measures the trade-off between precision and recall:

  • Better than AUC-ROC for imbalanced datasets
  • Focuses on the positive class performance
  • Range: 0 to 1, higher is better
  • Baseline depends on class imbalance (unlike ROC’s 0.5)

How It Works

When to use AUC-PR vs AUC-ROC:

  • AUC-PR: When positive class is rare and important (fraud, disease)
  • AUC-ROC: When both classes are equally important

Constructors

Constructor Summary
AUCPRMetric()

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)