karpathy/svmjs — pull request #3 by harthur (2012-11-22 03:48:07+00:00)
Title: Allow passing in the kernel function to `fromJSON()`

There's no way to JSON-ify the kernel function used to train an SVM, so `fromJSON()` needs a way to let you specify a kernel function.

This patch adds a second argument to `fromJSON()` which is the kernel function. It also adds a node.js test to the `test` directory.

*Side question*: I really like the `toJSON()/fromJSON()` functions because I can train an SVM, store the trained state in JSON and load it in later in another place. But it looks like it has to store all the training data and labels as well. The problem is I have thousands of pieces of ~1000 dimension data, so storing that isn't ideal.

Is there any way avoid storing the training data and labels? Does the SVM always need the original data when it's predicting?