Expand description
Confidence threshold analysis for NER systems.
Analyzes how precision, recall, and F1 change at different confidence thresholds. Useful for:
- Finding optimal operating points
- Understanding precision-recall tradeoffs
- Setting production thresholds
§Example
use anno_eval::eval::threshold_analysis::{ThresholdAnalyzer, PredictionWithConfidence};
let predictions = vec![
PredictionWithConfidence::new("John", "PER", 0.95, true),
PredictionWithConfidence::new("maybe", "PER", 0.45, false), // Wrong
PredictionWithConfidence::new("Google", "ORG", 0.88, true),
];
let analyzer = ThresholdAnalyzer::default();
let curve = analyzer.analyze(&predictions);
println!("Optimal threshold: {:.2} (F1: {:.1}%)",
curve.optimal_threshold, curve.optimal_f1 * 100.0);Structs§
- Prediction
With Confidence - A prediction with confidence and correctness label.
- Threshold
Analyzer - Analyzer for confidence threshold effects.
- Threshold
Curve - Full threshold analysis results.
- Threshold
Point - Metrics at a specific threshold.
Functions§
- format_
threshold_ table - Format threshold curve as ASCII table.
- interpret_
curve - Interpret threshold curve quality.