public static WheatSeedSpecies EstimateSpecie(double[] typeProbabilities, double certaintyThreshold = defaultCertaintyThreshold) { WheatSeedSpecies result = WheatSeedSpecies.Unknown; if (typeProbabilities[0] > certaintyThreshold) //Assumed to be this type { if (result == WheatSeedSpecies.Unknown) { result = WheatSeedSpecies.Kama; } else { return(WheatSeedSpecies.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 == WheatSeedSpecies.Unknown) { result = WheatSeedSpecies.Rosa; } else { return(WheatSeedSpecies.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 == WheatSeedSpecies.Unknown) { result = WheatSeedSpecies.Canadian; } else { return(WheatSeedSpecies.Unknown); //It was classified already as another type. It can't define between types! } } return(result); }
internal static bool IsUnknownType(WheatSeedSpecies type) { return(type == WheatSeed.WheatSeedSpecies.Unknown); }
public WheatSeed(double area, double perimeter, double compactness, double lengthOfKernel, double widthOfKernel, double asymetryCoefficient, double lengthOfKernelGroove, WheatSeedSpecies species) { Inputs.Add(area); Inputs.Add(perimeter); Inputs.Add(compactness); Inputs.Add(lengthOfKernel); Inputs.Add(widthOfKernel); Inputs.Add(asymetryCoefficient); Inputs.Add(lengthOfKernelGroove); double[] speciesMappedValues = new double[3];//Kama,Rosa & Canadian speciesMappedValues[0] = Convert.ToDouble(species == WheatSeedSpecies.Kama); speciesMappedValues[1] = Convert.ToDouble(species == WheatSeedSpecies.Rosa); speciesMappedValues[2] = Convert.ToDouble(species == WheatSeedSpecies.Canadian); Outputs.AddRange(speciesMappedValues); }