Metadata-Version: 2.4
Name: scikit-learner
Version: 0.1.1
Summary: Train ML models without leaving your browser 📈
Project-URL: Homepage, https://scikit-learner.app
Project-URL: Repository, https://github.com/yanndebray/scikit-learner
Project-URL: Issues, https://github.com/yanndebray/scikit-learner/issues
Author-email: Yann Debray <yann.debray@probabl.ai>
License: BSD 3-Clause License
        
        Copyright (c) 2026, Yann Debray
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Keywords: education,machine-learning,pyodide,scikit-learn,wasm
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Scikit-Learner 📈

A web-based machine learning application for training and comparing regression and classification models. **This runs scikit-learn directly in the user's browser via [Pyodide](https://pyodide.org/), so the whole app deploys as a static website.**

![learner app](landing/img/learner.png)

## Features

- **27 Regression Models** across 6 categories
- **22 Classification Models** across 6 categories
- **Interactive Plotly visualizations** — scatter, residuals, predicted vs actual, ROC, confusion matrix, comparison bar chart
- **Cross-Validation** (3 / 5 / 10 folds)
- **Sample Datasets** — Iris, Wine, Breast Cancer, Digits (classification); Diabetes, Boston-synthetic, Airfoil, Synthetic (regression)
- **Model Export** — joblib bytes, single-file or zipped bundle

## How it works

```
┌───────────────────────────────────────────────────────────┐
│  Browser                                                  │
│  ┌─────────────────────────────────────────────────────┐  │
│  │  index.html + Bootstrap + Plotly                    │  │
│  │  ↓ pyCall('train', [...])                           │  │
│  │  ┌────────────────────────────────────────────────┐ │  │
│  │  │  pyodide-bridge.js                             │ │  │
│  │  │  • loads Pyodide from JSDelivr CDN             │ │  │
│  │  │  • installs scikit-learn / pandas / numpy /    │ │  │
│  │  │    scipy / joblib                              │ │  │
│  │  │  • runs frontend/py/learner.py inside Pyodide  │ │  │
│  │  │  • thin pyCall / pyCallBinary wrappers         │ │  │
│  │  └────────────────────────────────────────────────┘ │  │
│  └─────────────────────────────────────────────────────┘  │
└───────────────────────────────────────────────────────────┘
                  (no network calls after first load)
```

First load: ~10 s (downloads Pyodide runtime + sklearn wheel, ~15 MB total).
Subsequent loads: ~1 s thanks to browser cache.

## Running locally

This is a 100% static site — no Python virtualenv, no Node toolchain, no backend to start. Any static file server will do; the snippet below uses Python's stdlib server only because it's universally available.

```bash
python3 -m http.server -d frontend 8080
open http://localhost:8080/
```

Edit any file under `frontend/` and reload the browser.

If you change `frontend/py/learner.py`, the browser fetches it fresh on reload — but Pyodide doesn't pick up the change until the module is re-imported. Hard-reload (Cmd-Shift-R / Ctrl-F5) or open a new tab.

## Deploy

Upload `frontend/` to any static host (Netlify, GitHub Pages, S3, …).

## Testing

A Playwright end-to-end spec covers Pyodide bootstrap, sample loading, training, predictions, export, and the UI scatter-plot render — 8 assertions, runs against either a local `python -m http.server -d frontend` or the public URL.

## Caveats (WASM)

- Pyodide initial load adds ~10 s and ~15 MB of one-time download. Loading overlay covers it.
- CSV upload capped at 20 MB (Pyodide's WASM heap).
- The `airfoil` dataset is bundled as `frontend/data/airfoil.csv` because Pyodide can't reach `fetch_openml` from inside the browser.
- Boston-housing uses the synthetic generator (real Boston was removed from sklearn ≥1.2).

## License

BSD