isOverconfident static method

bool isOverconfident(
  1. List<ConfidenceEvent> events, {
  2. double threshold = 0.25,
})

Whether the learner is overconfident on a given topic.

Returns true when the mean predicted confidence exceeds the mean actual performance by more than threshold (default 0.25 on the 0-1 scale).

Implementation

static bool isOverconfident(
  List<ConfidenceEvent> events, {
  double threshold = 0.25,
}) {
  if (events.length < 3) return false; // need enough data
  var totalPredicted = 0.0;
  var totalActual = 0.0;
  for (final e in events) {
    totalPredicted += (e.predictedConfidence - 1) / 4.0;
    totalActual += e.actualPerformance;
  }
  final meanPredicted = totalPredicted / events.length;
  final meanActual = totalActual / events.length;
  return (meanPredicted - meanActual) > threshold;
}