Also check out same GUI
demo with Neural Networks here.

Also check out same GUI
demo with Random Forest here.

Support Vector Machine in Javascript

Uses SMO algorithm. Find code on Github
Find me on Twitter @karpathy

mouse click: add red data point
shift + mouse click: add green data point
'k': toggle between Linear and Rbf kernel
'r': reset

Browser not supported for Canvas. Get a real browser.

C = 1.0

RBF Kernel sigma = 1.0
Note, these demos are somewhat depractated in favor of much better and recent ones over at Also, ConvNetJS supports (linear) SVMs as a special case, where the Neural Network has no hidden layers and the loss function is the hinge loss. However, the solution is obtained in primal with subgradient descent.