Implement the svm predict functions. TODO: review it for some petential issues and unit tests