hasCloseAlternatives property

bool get hasCloseAlternatives

Checks if there are close alternative predictions.

Returns true if there's another species with probability within 0.2 of the top prediction, indicating potential ambiguity.

Implementation

bool get hasCloseAlternatives {
  final alternatives = alternativeSpecies;
  if (alternatives.isEmpty) return false;

  final topAlternative = alternatives.values.first;
  return (topProbability - topAlternative) < 0.2;
}