This function applies a Support Vector Machine (SVM) model previously trained by a SVM procedure to a feature vector, predicting a label or returning a regression result. It is a wrapper around the popular open-source LIBSVM library. For more information about LIBSVM: http://www.csie.ntu.edu.tw/~cjlin/libsvm/
A new function of type svm named <id> can be created as follows:
mldb.put("/v1/functions/"+<id>, {
"type": "svm",
"params": {
"modelFileUrl": <Url>
}
})with the following key-value definitions for params:
| Field, Type, Default | Description |
|---|---|
modelFileUrl | URL of the model file (with extension '.svm') to load. This file is created by a procedure of type 'svm.train'. |
The SVM function of this type has a single input value called embedding which is a feature vector corresponding to the
feature vector that was used for training the SVM model, without the label.
The function outputs a single value output which depend on the type of SVM trained:
classification and nu-classification will return the predicted label of the feature vectorone class will return a value corresponding to how alike the feature vector is to the training dataregression and nu-regression will return the regression valueclassifier.test procedure type allows the accuracy of a predictor to be tested against
held-out data.svm.train procedure type trains an SVM.