  We develop and demonstrate a probabilistic method for classifying rare
objects in surveys with the particular goal of building very pure samples. It
works by modifying the output probabilities from a classifier so as to
accommodate our expectation (priors) concerning the relative frequencies of
different classes of objects. We demonstrate our method using the Discrete
Source Classifier, a supervised classifier currently based on Support Vector
Machines, which we are developing in preparation for the Gaia data analysis.
DSC classifies objects using their very low resolution optical spectra. We look
in detail at the problem of quasar classification, because identification of a
pure quasar sample is necessary to define the Gaia astrometric reference frame.
By varying a posterior probability threshold in DSC we can trade off sample
completeness and contamination. We show, using our simulated data, that it is
possible to achieve a pure sample of quasars (upper limit on contamination of 1
in 40,000) with a completeness of 65% at magnitudes of G=18.5, and 50% at
G=20.0, even when quasars have a frequency of only 1 in every 2000 objects. The
star sample completeness is simultaneously 99% with a contamination of 0.7%.
Including parallax and proper motion in the classifier barely changes the
results. We further show that not accounting for class priors in the target
population leads to serious misclassifications and poor predictions for sample
completeness and contamination. (Truncated)
