diff --git a/CLAUDE.md b/CLAUDE.md index 0129fde..33def0b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,7 +24,7 @@ No build step, no dependency install, no backend process. Pyodide and its packag The whole app pivots around three files. Understanding the contract between them is the key to being productive here. -- **`frontend/py/learner.py`** — pure Python module. Every former HTTP endpoint is a top-level function (`upload_csv`, `load_sample`, `train`, `train_all`, `predictions`, `scatter_data`, `export_model`, `bulk_zip`, `comparison`, etc.) that takes JSON-serializable args and returns a `dict` (or raw `bytes` for downloads). Module-level `current_data` dict holds session state — dataframe, trained models, task type. Each browser tab is its own Pyodide instance, so global state is fine. +- **`frontend/py/learner.py`** — pure Python module. Every former HTTP endpoint is a top-level function (`upload_csv`, `load_sample`, `train`, `predictions`, `scatter_data`, `export_model`, `bulk_zip`, `comparison`, etc.) that takes JSON-serializable args and returns a `dict` (or raw `bytes` for downloads). Module-level `current_data` dict holds session state — dataframe, trained models, task type. Each browser tab is its own Pyodide instance, so global state is fine. - **`frontend/js/pyodide-bridge.js`** — boots Pyodide, loads packages, copies `data/airfoil.csv` into the Pyodide MEMFS at `/data/airfoil.csv`, executes `learner.py`, then exposes a tiny surface on `window`: - `pyCall(fnName, [primitiveArgs])` — for JSON-able calls. Builds a Python expression string and runs it via `runPython`. Result is converted with `toJs({dict_converter: Object.fromEntries})`. - `pyCallBinary(fnName, Uint8Array, extraArgs)` — passes a binary buffer via a `globals.set('__bridge_buf', ...)` shim (used by `upload_csv`). diff --git a/frontend/index.html b/frontend/index.html index 4313922..654c965 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -86,9 +86,6 @@

📈 Scikit-Learner

-
diff --git a/frontend/js/app.js b/frontend/js/app.js index fe7b08c..38b0cd7 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -347,7 +347,6 @@ function updateTrainButtons() { const hasSelectedModels = state.selectedModelsToTrain.size > 0; document.getElementById('trainBtn').disabled = !(hasData && hasTarget && hasFeatures && hasSelectedModels); - document.getElementById('trainAllBtn').disabled = !(hasData && hasTarget && hasFeatures); } // Show new data modal (unified) @@ -722,15 +721,6 @@ async function trainSelectedModels() { await trainModels(modelsToTrain); } -// Train all available models -async function trainAllModels() { - const allModels = []; - for (const models of Object.values(state.availableModels)) { - models.forEach(m => allModels.push(m.key)); - } - await trainModels(allModels); -} - // Train models async function trainModels(modelKeys) { showLoading(); diff --git a/frontend/py/learner.py b/frontend/py/learner.py index e6d436a..c366fef 100644 --- a/frontend/py/learner.py +++ b/frontend/py/learner.py @@ -467,21 +467,6 @@ def train( "n_features": len(features), } - -def train_all(features: list, target: str, cv_folds: int = 5, task_type: str = "regression") -> dict: - """Train every model in the active dictionary, reporting per-model success.""" - if hasattr(features, "to_py"): - features = list(features.to_py()) - src = AVAILABLE_CLASSIFICATION_MODELS if task_type == "classification" else AVAILABLE_MODELS - results = [] - for key in src: - try: - results.append(train(key, features, target, cv_folds, task_type)) - except Exception as e: - results.append({"success": False, "model_type": key, "error": str(e)}) - return {"results": results} - - def get_model(model_id: str) -> dict: if model_id not in current_data["models"]: raise ValueError("Model not found")