1. A method of sorting haploid seeds, comprising:providing a population of seeds to be sorted, each seed being either a haploid seed or a diploid-hybrid seed;
providing an apparatus comprising a light source and a spectrometer capable of examining each seed individually;
illuminating each seed with light generated by the light source;
acquiring at least one spectrum of each seed;
processing the at least one spectrum of each seed using computer software with user-determined parameters and storing the data in a data matrix;
calibrating a regression model based on a portion of the data matrix that excludes a selected genotype of seeds, the genotype being considered a held-out genotype;
cross-validating the regression model by holding out each genotype present in the population of seeds and repeating the classification step; and
classifying a randomly sampled seed using the validated model.