Square/rectangle SVM train method