public static IrisSpecies EstimateSpecie(double[] typeProbabilities, double certaintyThreshold = defaultCertaintyThreshold) { IrisFlower.IrisSpecies result = IrisFlower.IrisSpecies.Unknown; if (typeProbabilities[0] > certaintyThreshold) //Assumed to be this type { if (result == IrisSpecies.Unknown) { result = IrisSpecies.Setosa; } else { return(IrisSpecies.Unknown); //It was classified already as another type. It can't define between types! } } if (typeProbabilities[1] > certaintyThreshold) //Assumed to be this type { if (result == IrisSpecies.Unknown) { result = IrisSpecies.Versicolor; } else { return(IrisSpecies.Unknown); //It was classified already as another type. It can't define between types! } } if (typeProbabilities[2] > certaintyThreshold) //Assumed to be this type { if (result == IrisSpecies.Unknown) { result = IrisSpecies.Virginica; } else { return(IrisSpecies.Unknown); //It was classified already as another type. It can't define between types! } } return(result); }
public static bool IsUnknownType(IrisFlower.IrisSpecies type) { return(type == IrisFlower.IrisSpecies.Unknown); }