Interactive machine learning playground built with React, DanfoJs and Scikit Learn JS where data loading, feature engineering, train/test split, model training, and inference run fully in the browser.
View Live site: https://mrishab.github.io/ML-Playground/
- Loads bundled CSV datasets from the public folder.
- Lets you inspect tables and basic dataset statistics.
- Supports feature selection and feature transformations (regular, polynomial, interaction terms).
- Builds train/test splits directly in client-side.
- Trains models in-browser using scikitjs with TensorFlow.js backend.
- Shows prediction and evaluation metrics for browser-executed models.
This is a static frontend application:
- No server-side API calls for ML execution.
- No database.
- No backend training job queue.
- Data + model operations happen in the browser tab (client runtime).
Implications:
- Training/inference speed depends on the user's device and browser.
- Closing or refreshing the tab clears in-memory state unless persisted by the app.
- Best experience is with small-to-medium datasets and moderate feature counts.
- React 19 + TypeScript
- Vite 6 - build tool
- Tailwind CSS - styling
- Zustand state management
- Danfo.js for dataframe-like operations (Pandas alternative)
- scikitjs + TensorFlow.js for in-browser ML
- Plotly for visualization (Matplotlib alternative)
- GitHub Pages for deployment
- macOS, Linux, or Windows with a Unix-like shell
- Git
- Node.js 20.17.0 (required)
- npm (ships with Node)
- Optional but recommended:
- nvm (Node version manager)
- direnv (auto-load project shell environment)
Node version policy (from package engines):
-
= 20.17.0 and < 21
git clone https://github.com/mrishab/ML-Playground.git
cd ML-PlaygroundThis repo includes .nvmrc with Node 20.17.0.
nvm install
nvm use
node -vIf nvm is not installed yet (macOS, Homebrew):
brew install nvm
mkdir -p ~/.nvmThen follow the nvm shell-init instructions shown by Homebrew.
This repo includes .envrc that loads nvm and runs nvm use automatically.
Install direnv (macOS):
brew install direnvHook direnv into your shell (one-time), then from the repo root:
direnv allowAfter this, entering the project directory auto-selects the correct Node version.
npm installStart dev server:
npm run devDefault local URL:
Hot Module Replacement (HMR) is enabled, so UI/code changes appear live in the browser while developing.
Lint + format check:
npm run checkAuto-fix lint + formatting:
npm run fixCreate optimized build:
npm run buildPreview production build locally:
npm run previewDeployment is automated via GitHub Actions workflow on pushes to main.
How to publish changes:
- Commit your changes.
- Push to main.
- GitHub Actions builds and deploys dist to GitHub Pages.
- Refresh the live URL after workflow completes.
Notes:
- Vite base path is configured for GitHub Pages project hosting (/ML-Playground/).
- First load after deploy may be cached; hard refresh if you do not see updates immediately.
Dependencies fail to install:
- Remove node_modules and package-lock.json, then rerun npm install.
App loads but routes/assets break on Pages:
- Ensure deployment is built from this repo config with the existing Vite base path.