NPVMetric<T>
Models & Types · AiDotNet.Evaluation.Metrics.Classification
Computes Negative Predictive Value (NPV): proportion of negative predictions that are correct.
Implements: IClassificationMetric<T>
For Beginners
NPV answers: “When my model predicts negative, how often is it right?”
- NPV = 1: Every negative prediction is correct (no false negatives among negative predictions)
- NPV = 0.8: 80% of negative predictions are correct
Important in medical diagnostics: high NPV means you can trust a negative test result. Related to but different from Specificity (TN / (TN + FP)).
How It Works
NPV = TN / (TN + FN)
Constructors
| Constructor | Summary |
|---|---|
NPVMetric() |
|
NPVMetric(T positiveLabel) |
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) |