FIG. 25 shows a method 2500 of using a classification library. In this example, the method comprises a step 2502 of obtaining a set of plural sample spectra. The method then comprises a step 2504 of calculating a probability or classification score for the set of plural sample spectra for each class of sample using metadata for the class entry in the classification library. This may comprise using a different set of class-specific background-subtracted sample spectra for each class so as to provide a probability or classification score for that class. The sample spectra are then classified at step 2506 and the classification is then output in step 2508.
Classification of a sample will now be described in more detail with reference to the classification library described above.
In this example, an unknown sample spectrum y is the median spectrum of a set of plural sample spectra. Taking the median spectrum y can protect against outlying data on a channel by channel basis.
The likelihood Ls for the input data given the library entry s is then given by: