Code for SVM.