FIX error handling in SVM

Didn't work when y not an array.