Graphical ML experiment builder
The
/ml/builderpage composes datasets, preprocessing, model definitions, experiment records, deployments, and quick tests on a shared XYFlow canvas. Same plumbing as the Bot Builder.
Where it lives
- Route:
src/routes/ml/builder/page.tsx(MlBuilderRoute, in thealphaswarm_clientrepo — the frontend is a Vite + react-router SPA, not a Next.jsapp/tree). - Palette:
src/components/ml/mlPalette.ts(ML_PALETTE,ML_NODE_ACCENTS) - Serializer:
src/components/ml/mlSerializer.ts(serializeMlExperiment) - Canvas:
src/components/flow/WorkflowEditor.tsx
Palette layout
Each palette section maps onto a list of node kinds defined in
mlPalette.ts. This is a deliberately "distilled" palette — one
canonical tile per concept — rather than an earlier, larger tile
catalogue; there is currently no separate Records or Deploy section on
the canvas.
| Section | Kinds |
|---|---|
| Source | Dataset, DatasetPreset, IcebergSlice, FetcherSource, FeatureSet |
| Pipeline | Preprocessing, MLScale, MLWinsorize, MLLag, MLRolling, MLDecompose |
| Split | WalkForward, PurgedKFold, ChronologicalRatio |
| Model | LightGBMModel, XGBoostModel, SklearnModel, TorchModel, KerasModel |
| Experiment | ForecastExperiment, ClassificationExperiment, AnomalyExperiment |
| Test | SinglePredictTest, BatchPredictTest, ABCompareTest |
Dispatch
mlSerializer.ts::serializeMlExperiment builds one MlExperimentRequest
payload from whatever Dataset / Split / Preprocessing / Model / Experiment
node it finds on the canvas (it throws if the Dataset or Model node is
missing / unpopulated). The builder route always POSTs that payload to a
single endpoint, POST /ml/experiment-runs, which queues a training
Celery task — there is currently no per-node-kind dispatch to a
separate alpha-backtest or test endpoint from this canvas. See
AlphaBacktestExperiment for the (separately
triggered) POST /ml/alpha-backtest-runs flow.
Adding a new palette tile
- Append an entry to the appropriate
PaletteSectioninmlPalette.ts. - Add an accent color to
ML_NODE_ACCENTS. - If the new kind needs special serialization, extend the relevant
*_KINDSset and helper logic inmlSerializer.ts.