Fixup bad confidence function.
Add code to train a classifier.