SpecificityMetric<T>

Models & Types · AiDotNet.Evaluation.Metrics.Classification

Computes specificity (true negative rate): the proportion of actual negatives correctly identified.

Implements: IClassificationMetric<T>

For Beginners

Specificity answers: “Of all actual negatives, how many did the model correctly identify?” High specificity means few false positives. A spam filter with 99% specificity means it correctly lets through 99% of legitimate emails.

How It Works

Specificity = TN / (TN + FP) = True Negatives / Actual Negatives

Constructors

Constructor Summary
SpecificityMetric()
SpecificityMetric(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)