A JavaScript reimagining of Weka — machine learning algorithms that run entirely in your browser. Nothing to install. Everything runs locally.
- Preprocess — Upload CSV or ARFF datasets. Inspect attribute statistics, distributions, and missing values.
- Classify — Run k-NN and Naïve Bayes classifiers. Evaluate with cross-validation or a percentage hold-out split.
- Cluster — Discover structure with k-Means. Visualize cluster assignments and within-cluster variance.
- Visualize — Interactive 2-D scatter plots — select any two attributes and colour by class.
| Algorithm | Type | Implementation |
|---|---|---|
| k-Nearest Neighbor | Classification | lib/algorithms/knn.js |
| Naïve Bayes | Classification | lib/algorithms/naiveBayes.js |
| k-Means | Clustering | lib/algorithms/kmeans.js |
- ARFF (Weka's Attribute-Relation File Format) — sample datasets in
public/datasets/ - CSV — first row treated as header; last column used as class attribute
npm install
npm run dev # starts on http://localhost:3200The site is a Next.js static export.
next build writes the fully-rendered HTML/CSS/JS to out/.
That directory is what gets published to GitHub Pages — the master branch is source-only; the live site is served from the gh-pages branch.
master ← all source code lives here
gh-pages ← only the contents of out/ live here (managed automatically)
# One command — builds the static export then pushes out/ to gh-pages:
npm run deployThat runs next build (writes to out/) then uses the gh-pages package to force-push out/ to the gh-pages branch on origin with a single commit.
GitHub Pages is configured (in the repo Settings → Pages) to serve from the
gh-pagesbranch, root/. The custom domain is wired up viapublic/CNAME(machinelearning.js.org) which is copied intoout/automatically during the build.public/.nojekyllis also copied, which tells GitHub Pages not to run Jekyll — required so the_next/static assets folder is served correctly.
npm run export # produces out/ without touching the gh-pages branchUseful for inspecting the static output locally:
npm run export
npx serve out # or: python3 -m http.server 8080 -d outSource lives on master. Normal workflow:
git add -p # stage changes
git commit -m "feat: description"
git push origin master # push source
npm run deploy # separately push the built site to gh-pagesgit push origin master and npm run deploy are independent — the deploy step only touches the gh-pages branch.
After npm run deploy completes (takes ~30 s for GitHub to propagate):
https://machinelearning.js.org
GitHub Actions is not used — the gh-pages npm package handles the push directly from your local machine.
Witten, Frank, Hall & Pal — Data Mining: Practical Machine Learning Tools and Techniques (4th ed.) University of Waikato
Next.js 16 · Material UI v6 · Recharts · Material React Table · App Router · Static Export