SVM implementation on 3 classes