implement SVM training and xvalidation