calibrationError static method
- List<
ConfidenceEvent> events
Mean absolute error between predicted (normalized to 0-1) and actual.
Implementation
static double calibrationError(List<ConfidenceEvent> events) {
if (events.isEmpty) return 0;
var totalError = 0.0;
for (final e in events) {
final predicted = (e.predictedConfidence - 1) / 4.0; // 1-5 → 0-1
totalError += (predicted - e.actualPerformance).abs();
}
return totalError / events.length;
}