gitwtfhub

wtf is svmjs?

karpathy/svmjs — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2018-04-14

711JavaScriptAudience · developerComplexity · 3/5DormantSetup · easy

TL;DR

svmjs is a lightweight JavaScript library for training a Support Vector Machine classifier entirely in the browser or Node.js, letting you build interactive machine-learning demos without a Python backend.

Mindmap

mindmap
  root((repo))
    What it does
      Trains SVM classifier
      Runs in browser
      No Python needed
    Tech stack
      JavaScript
      SMO algorithm
      Kernel functions
    Use cases
      Interactive ML demos
      Frontend classification
      Quick prototyping
    Tradeoffs
      Lightweight
      Slower on complex data
      Save and reload models

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build an interactive web demo where users draw and label points to watch an SVM learn a decision boundary live

REASON 2

Add ML classification directly in a frontend app without calling an external API

REASON 3

Prototype a two-category classifier quickly in a Jupyter notebook using JavaScript

REASON 4

Train a model once, save it as JSON, and load it elsewhere to classify new data

What's in the stack?

JavaScript

How it stacks up

karpathy/svmjsyyx990803/html5-cleartruelockmc/streambert
Stars711720728
LanguageJavaScriptJavaScriptJavaScript
Last pushed2018-04-142020-10-02
MaintenanceDormantDormant
Setup difficultyeasyeasyeasy
Complexity3/52/51/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

Best results require tuning the kernel choice and the C parameter for your specific dataset.

License terms are not described in the explanation, check the repository directly before use.

Yoink these prompts

Prompt 1
Using svmjs, help me build an interactive web page where users click to add labeled points and see the SVM decision boundary update live.
Prompt 2
Show me how to train an SVM with svmjs using a linear kernel first, then switch to an RBF kernel if the results aren't good enough.
Prompt 3
Write JavaScript code using svmjs that trains a classifier on a small labeled dataset and saves the trained model as JSON.
Prompt 4
Explain how to tune the C parameter in svmjs to balance strict fitting versus generalization on my training data.
Prompt 5
Load a previously saved svmjs model from JSON and use it to classify a new batch of unlabeled data points.

Frequently asked questions

wtf is svmjs?

svmjs is a lightweight JavaScript library for training a Support Vector Machine classifier entirely in the browser or Node.js, letting you build interactive machine-learning demos without a Python backend.

What language is svmjs written in?

Mainly JavaScript. The stack also includes JavaScript.

Is svmjs actively maintained?

Dormant — no commits in 2+ years (last push 2018-04-14).

What license does svmjs use?

License terms are not described in the explanation, check the repository directly before use.

How hard is svmjs to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is svmjs for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.