Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

OpenML Lab

Learn. Train. Predict. Share.

OpenML Lab is a free, open-source machine-learning laboratory that runs entirely in your browser. Pick a sample dataset (or load your own CSV), train a classification or regression model, watch it learn, test predictions, and read plain-language explanations of what the numbers do and do not mean.

  • No account, no server, no database, no API key, no payment, no analytics.
  • Your CSV files are read locally and never uploaded.
  • Hosted as a static site on GitHub Pages; built with React, TypeScript, Vite and TensorFlow.js.

Public URL: none yet. This repository has been prepared but not deployed. After you follow Publishing your site will be at https://<your-github-username>.github.io/<your-repo-name>/.

Features

Area What you can do
Classification Logistic regression (softmax) and a small neural network (MLP) via TensorFlow.js; k-nearest neighbours in plain TypeScript. Predicted class and per-class confidence; decision-region plots for two-feature slices.
Regression Gradient-descent linear regression and a small neural network (MLP) via TensorFlow.js; closed-form ridge regression in TypeScript. Editable inputs, live predictions, fitted-curve plot.
Training playground Choose an algorithm, adjust its parameters, start / stop / restart, see loss and score curves per epoch, and read a beginner-friendly interpretation (including overfitting warnings).
Dataset lab Six deterministic synthetic sample datasets (downloadable as CSV), CSV upload with validation and preview, feature/target selection, and safe handling of missing values (drop rows, or fill with the training-set mean).
Evaluation Accuracy, macro precision / recall / F1 and a confusion matrix for classification; MAE, RMSE and R² for regression. Training, validation and test results are shown separately; a majority-class baseline is shown for context.
Learning section Short explanations of classification, regression, training, validation, test data, overfitting and prediction, with runnable demonstrations.
UI Responsive (phone / tablet / desktop), light and dark themes, keyboard navigation with a skip link, clear loading / success / error states.

Sample project you can run immediately

Open the Lab page and press Run sample classification project (synthetic flowers + logistic regression) or Run sample regression project (synthetic house prices + gradient-descent linear regression). The first run downloads TensorFlow.js once (several MB); k-NN and ridge regression do not need it.

About the data

All built-in datasets are synthetic: generated by a seeded random-number generator, so they are identical on every machine and add nothing to the download size. They are teaching tools, not real-world data, and results on them say nothing about real problems.

Quick start

Requires Node.js 20 or newer.

npm install        # first run creates package-lock.json - commit it
npm run dev        # http://localhost:5173
npm test           # unit tests (Vitest)
npm run lint       # ESLint
npm run build      # type-check + production build into dist/
npm run preview    # serve dist/ locally
VITE_BASE=/openml-lab/ npm run build && npm run verify:dist -- dist /openml-lab/

Project structure

src/
  components/   Reusable UI (layout, charts, panels, shared state)
  pages/        Home, Lab, Datasets, Train, Learn, About
  ml/           Splitting, preprocessing, metrics, algorithms, trainer, explanations
  data/         Deterministic synthetic sample datasets
  utils/        CSV parser/validator, sanitising, seeded RNG, hash router, theme
public/         Static files (favicon, theme bootstrap script)
tests/          Vitest unit tests
scripts/        verify-dist.mjs - production asset-path checker
.github/workflows/deploy.yml   CI + GitHub Pages deployment

How the machine learning is kept honest

  • Seeded, reproducible splits. Rows are split into train / validation / test (60 / 20 / 20) with a seeded shuffle. Classification splits are stratified so every class appears in every part.
  • No data leakage. Column choices that depend on row contents (feature means, standard deviations, mean-imputation values, target scaling) are computed on the training rows only and then applied to validation and test rows. A unit test tampers with the held-out rows and checks the fitted statistics do not move. The target column cannot also be a feature.
  • Test data is for the final number. Validation data drives the curves you watch while training. The test split is never used to train, tune or stop a model; it is evaluated once at the end (and its points are drawn, clearly labelled, on the plots).
  • Baselines and caveats. The majority-class baseline is displayed; small test sets and perfect scores trigger warnings; results are never described as guarantees.
  • Determinism. Data generation, splitting, weight initialisation and data order are seeded. TensorFlow.js results on one backend are repeatable but may differ slightly between backends (CPU vs WebGL).

Privacy and security

  • CSV files are processed in the browser and never sent anywhere. Nothing is stored except your theme choice (localStorage).
  • Uploads are limited to 5 MB, 20,000 rows and 100 columns, and are checked for type, binary content and malformed quoting. Column names and cell values are sanitised before display; the app never uses innerHTML or dangerouslySetInnerHTML.
  • A Content-Security-Policy <meta> tag is added to production builds (GitHub Pages cannot send HTTP headers). It currently allows 'unsafe-eval' as a precaution for TensorFlow.js; see SECURITY.md.
  • Browser-side processing does not guarantee complete security. A maliciously crafted file or a browser vulnerability could still cause harm. Do not load highly sensitive data on shared or untrusted computers.

Publishing to GitHub Pages

Everything below is a one-time setup. No secrets or tokens are needed; the workflow uses GitHub's built-in GITHUB_TOKEN.

  1. Create the lockfile (the workflow refuses to run without it):
    npm install
    git add package-lock.json
  2. Create an empty public repository on GitHub (for example openml-lab) and push:
    git remote add origin https://github.com/<your-username>/openml-lab.git
    git branch -M main
    git commit -am "Add lockfile"
    git push -u origin main
  3. Enable Pages with GitHub Actions: repository Settings → Pages → Build and deployment → Source: GitHub Actions.
  4. Check Actions is allowed: Settings → Actions → General → Actions permissions must allow GitHub-authored actions (the default). The default Workflow permissions ("Read repository contents") are fine: the workflow requests only contents: read for building and pages: write + id-token: write for the deploy job.
  5. Check the github-pages environment (Settings → Environments) allows deployments from main (this is the default when Pages is enabled with Actions).
  6. (Optional) Enable Settings → Code security → Private vulnerability reporting so SECURITY.md works as written.
  7. Watch the run under the Actions tab. The deploy job prints the live URL when it finishes.

The base path is set automatically: /<repo-name>/ for project sites and / for repositories named <owner>.github.io. For a custom domain served at its root, build with VITE_BASE=/.

Checklist for verifying the public website

Do not consider the deployment verified until each box is ticked against the real URL.

  • The Actions run is green (lint, tests, build, asset-path verification, deploy).
  • The URL opens, the page is styled, and the favicon loads.
  • Browser dev tools → Network: no 404 responses and no requests to any other domain.
  • Browser dev tools → Console: no errors and no Content-Security-Policy violations.
  • Each page loads from the top nav, and reloading on #/lab, #/datasets, #/train, #/learn and #/about works.
  • Lab → Run sample classification project completes; the loss chart moves; test accuracy and a confusion matrix appear; the prediction form returns a class with confidence.
  • Lab → Run sample regression project completes; MAE, RMSE and R² appear; changing an input changes the prediction.
  • Train page: Stop interrupts a running neural-network job; Restart trains again.
  • Datasets: a valid CSV previews and can be trained on; an empty file, a .png, a binary file and a >5 MB file each show a clear error.
  • Light and dark themes both work and the choice persists after reload.
  • On a phone-width window (about 375 px) nothing scrolls sideways and all six nav links are visible.
  • Keyboard only: Tab reaches the "Skip to content" link first, every control is reachable, and focus is visible.
  • Throttle the network in dev tools: the first page load does not download the TensorFlow.js chunk until you train a gradient-based model.

Verification status (what has and has not actually been run)

This project was built in a sandbox that could not reach the npm registry, so Vite, TensorFlow.js, Vitest and ESLint could not be installed there. Be aware of what that means:

Check Status
Unit tests for CSV validation, sanitising, splitting, leakage, metrics, k-NN, ridge, datasets, trainer, explanations, dist verifier 74 tests passed under a small local stand-in for Vitest on Node's test runner. They have not been run under real Vitest.
Unit tests for the TensorFlow.js models (tests/tf.test.ts, 4 tests) Not run. TensorFlow.js was unavailable. Expect to confirm or adjust these (timeouts, thresholds) on your first npm test.
Strict TypeScript check of all source and tests Passed, but against minimal stand-in typings for React, TensorFlow.js and Vite. Calls into those libraries were not type-checked; run npm run build to confirm.
The real UI in a headless Chromium browser (esbuild bundle) Passed: all 6 pages × 3 viewports × light/dark rendered with no console errors, no horizontal overflow; a 29-point functional run covered dataset selection, k-NN and ridge training, results, predictions, missing-value handling, hostile and invalid uploads, keyboard and theme behaviour. TensorFlow.js-based training was not exercised in a browser.
vite build, eslint, npm ci Not run. No lockfile exists yet.
Production asset paths The checker script and its tests pass; it has not been run against a real vite build output.
GitHub Actions workflow YAML parses and the base-path logic was simulated; it has never run.
Deployment to GitHub Pages Not done. No repository URL or live URL exists.

Limitations and unfinished work

  • No model export, saving or share links. "Share" currently means open-source code and downloadable sample CSVs. Trained models disappear when you close the tab.
  • Numeric features only: no categorical (one-hot) features, text, images or time series.
  • Classification supports up to 20 classes; uploads are capped at 5 MB, 20,000 rows and 100 columns; datasets need at least 20 usable rows.
  • Decision regions are 2-D slices (other features held at their training mean), not the full decision surface.
  • Browser computing is limited: the first TensorFlow.js use downloads several MB, training large networks on a phone is slow, and if WebGL is unavailable TensorFlow.js falls back to a slow CPU backend. GitHub Pages is static hosting with no server-side compute, so there is no way to train on a remote GPU.
  • The CSP keeps 'unsafe-eval' until it has been confirmed in real browsers that TensorFlow.js trains without it.
  • Dependency versions are caret ranges chosen without registry access; npm install may need small adjustments, and licences of installed packages should be re-checked (see THIRD_PARTY_LICENSES.md).
  • Third-party licence notices: TensorFlow.js is Apache-2.0. Confirm that the built bundle (or a licences file served with the site) retains the required notices; this has not been checked against a real build.
  • Test coverage of React components is by browser walkthrough only; there are no component-level automated tests or end-to-end tests in CI yet.

Contributing

Contributions are welcome. See CONTRIBUTING.md. To report a vulnerability, see SECURITY.md.

License

MIT. Third-party dependencies and their licences are listed in THIRD_PARTY_LICENSES.md. No pretrained models or third-party datasets are bundled.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages