isConfident static method
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;
}