ml-svm
Support Vector Machine in Javascript
Installation
npm install ml-svm
API
Example
// Instantiate the svm classifiervar SVM = ; var options = C: 001 tol: 10e-4 maxPasses: 10 maxIterations: 10000 kernel: 'rbf' kernelOptions: sigma: 05 ; var svm = options; // Train the classifier - we give him an xorvar features = 00011110;var labels = 1 -1 1 -1;svm; // Let's see how narrow the margin isvar margins = svm; // Let's see if it is separable by testing on the training datasvm; // [1, -1, 1, -1] // I want to see what my support vectors arevar supportVectors = svm; // Now we want to save the model for later usevar model = svm; /// ... later, you can make predictions without retraining the modelvar importedSvm = SVM;importedSvm; // [1, -1, 1, -1]