Matt’s SVM classifier.
Porting to Python 3.