isConfident static method

bool isConfident(
  1. List<double> probabilities,
  2. double threshold
)

Whether the top prediction exceeds a confidence threshold.

Implementation

static bool isConfident(List<double> probabilities, double threshold) {
  final maxProb = probabilities.reduce((a, b) => a > b ? a : b);
  return maxProb >= threshold;
}