Skip to content
Documentation menu

How it works

Claude understands the problem. Python does the math. The two halves have separate jobs and a narrow interface between them: one command and a set of files.

The pipeline

Claude
  → dataset profiler
  → validation
  → forecasting engine
  → backtesting
  → model selection
  → forecast
  → Claude explanation

What Claude does

  • Parses what you asked for and picks the engine arguments.
  • Runs one command, forecast run. If the data is ambiguous (several numeric columns, an unclear date format, gaps that might mean zero), the engine exits with code 3 and a list of questions. Claude asks you, then re-runs with the flags you chose.
  • Reads the engine’s text report and, when needed, result.json, and explains it: what was observed, what is forecast, how reliable the backtest says it is, and which warnings matter.

What Python does

  • Profile and validate. Frequency, missing timestamps, duplicates, outliers, trend, seasonality. It can refuse a dataset that is too short or constant.
  • Backtest. Each eligible model is fit and scored on several held-out windows.
  • Select. A fixed rule picks the winner from the backtest errors.
  • Forecast. The winner is refit on all history and produces the forecast and prediction intervals.
  • Write outputs. CSV, JSON, and a chart. See Outputs.

Why Claude doesn’t calculate the forecast

A language model asked to predict numbers from a CSV produces plausible-looking answers with no error estimate and no way to check them. It is also not repeatable: the same file can give different numbers on different runs.

Statistical models fit by code are testable. They can be backtested against history, compared with simple baselines, and re-run to get the same answer. Claude is good at the parts code is bad at: working out what you meant and explaining the result in your terms.

Claude also never picks the winning model and never does arithmetic on the results. When Claude needs a number to say something true, the engine supplies it.

Privacy and cost

Claude never reads the raw rows. It works from the engine’s report and result file, so a large CSV doesn’t have to pass through the model.