refactored SVM train validate test