Saltar al contenido principal

Analysis Lab — interactive analysis builder

Backend: alphaswarm_docs/analysis-framework.md · Flow reference: alphaswarm_docs/analysis-flows.md.

Lives at /analysis/lab in the AlphaSwarm webui (Vite frontend). Hybrid surface: dataset-centric tabbed drill-down (primary path) plus an XYFlow Composer (secondary path) for multi-step pipelines.

Layout

TabPurposeDriving flows
ProfilingColumn profile + null audit + topk + dtypesprofiling.*
DistributionDescriptive stats / histogram / ECDF / Q-Q + Shapiro-Wilk / Jarque-Bera / K-Sdistribution.*
OutliersZ-score / IQR / Isolation Forest / DBSCAN / LOF / ECOD / pulse-vs-stepoutlier.*
Time SeriesADF / KPSS / ACF-PACF / STL / GARCH / change-point / Granger / cointegration / FFT / wavelets / Hurst / Theil-Sentime_series.*
RegressionOLS diagnostics / White / Breusch-Pagan / VIFregression.*
Imputationffill/bfill / linear / spline / KNN / MICEimputation.*
DerivativesBSM + Greeks surface + IV / Monte-Carlo European / barrier / Asian / SABR smile / Bachelierderivatives.*
PortfolioEfficient frontier / Ledoit-Wolf / Fama-French 5 rolling / risk parityportfolio.*
FactorsAlphalens-style IC + quantile spread + turnoverfactors.evaluate
ComposerXYFlow canvas — drag analysis nodes, save spec, run via runtimeevery namespace

Each tab loads the relevant flow schemas via GET /analysis/flows, auto-generates the form, and submits to POST /analysis/flows/{flow}/preview. Charts render inline (Plotly figure-dict in the response).

The "Save as spec" button on any tab promotes the current state into an AnalysisSpec and routes to the Composer for multi-step editing without losing context.

Routes

PathComponent
/analysis/labTabbed primary surface
/analysis/lab/composerXYFlow Composer (XYFlow canvas + ANALYSIS_PALETTE)
/analysis/runsRun ledger (paged)
/analysis/runs/[id]Run detail (steps + chart previews)

The Composer reuses the existing WorkflowEditor with domain="analysis". The serializer turns the canvas graph into an AnalysisSpec payload, posts it to POST /analysis/specs, then to POST /analysis/specs/{slug}/run.

API surface used

  • GET /analysis/flows — flow catalog with JSON-schema params.
  • POST /analysis/flows/{flow}/preview — sync preview.
  • POST /analysis/flows/{flow}/preview-task — Celery preview.
  • POST /analysis/specs — persist (hash-idempotent).
  • POST /analysis/specs/{slug}/run — queue AnalysisRuntime.run task.
  • GET /analysis/runs / GET /analysis/runs/{id} — ledger.
  • GET /analysis/runs/{id}/results/{step} — DuckDB preview of the gold-tier output for one step.
  • GET /analysis/datasets/columns?identifier=ns.name — column list used by the lab's column-autocomplete inputs.

The lab does not reinvent existing surfaces — it deep-links into them when the user wants a richer experience: