ThreatScoreMetric<T>

Models & Types · AiDotNet.Evaluation.Metrics.Classification

Computes Threat Score (Critical Success Index): TP / (TP + FN + FP).

Implements: IClassificationMetric<T>

For Beginners

Threat Score (also called Critical Success Index):

  • Measures overlap between predictions and actuals
  • Ignores True Negatives (TN)
  • Range: 0 to 1, higher is better
  • Used heavily in meteorology (weather forecasting)

How It Works

TS = TP / (TP + FN + FP)

When to use:

  • When True Negatives are common and not interesting
  • When you care about detecting rare events
  • Weather prediction, rare disease detection

Constructors

Constructor Summary
ThreatScoreMetric()

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)