EA-SVM optimization code