Skip to content

About

Forecast your pharmacy's numbers and find out which forecast to trust. Seven methods, honest rolling backtest, plain-English verdict. Runs offline on your own computer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Time Series Forecasting Bench

Forecast your pharmacy's numbers — and find out which forecast you can actually trust.

Paste a column of numbers. The app tests seven forecasting methods against your own history, scores each one on data it was never allowed to see, and tells you in plain English which to use and how much to rely on it.

Your data never leaves your computer. No server, no account, no telemetry, no internet connection required.


Then:

  1. Open your Downloads folder, right-click the file → Extract All… → Extract
  2. Open the new folder and double-click ForecastingBench

Nothing is installed. No admin rights, nothing written to Program Files or the registry, and no account to create.

If Windows says "Windows protected your PC" — click More info → Run anyway. That appears because the app is not code-signed (certificates cost several hundred dollars a year and this is free), not because anything was found. The first launch can take 10–20 seconds while Windows scans it.

Windows 10 or 11, 64-bit. ~270 MB download.


How to use it

1. Add your numbers. Any of these three work:

Just the numbers          Date + number             A spreadsheet
5200                      2023-01-01, 5200          Drag a .csv or .xlsx
5400                      2023-02-01, 5400          onto the window
5800                      2023-03-01, 5800

Oldest first. Dollar signs and commas are fine — $12,400 works. Adding dates lets the app detect seasonal patterns. You need at least 20 data points; 30+ is much more reliable.

2. Choose how far ahead you want to forecast.

3. Read the verdict. You get a ranked table, a chart with a prediction range, and a one-sentence answer in plain English.


What it actually does

Most forecasting tools show you one number and no way to judge it. This one runs a rolling-origin backtest: it repeatedly hides the last few periods of your history, forecasts them, and compares against what really happened. Every method is scored the same way, on the same windows.

The prediction range is then calibrated by split conformal — and, importantly, the reliability percentage you see is measured on windows that were not used to calibrate it. That is why a method can win on accuracy and still show a range reliability well below 95%: the number is honest rather than circular.

Methods compared

Method Notes
Last-value baseline Seasonal naive — the honest thing to beat
Trend baseline Straight-line drift
ARIMA statsforecast AutoARIMA
Exponential Smoothing (ETS) statsforecast AutoETS
Theta Winner of the M3 competition
Smoothed Trend (built-in) Holt-style level + trend
Seasonal Weighted Average (built-in) Weighted recent average with a seasonal factor

The AI models are optional. Inside the app, a button downloads Google TimesFM 2.5 (882 MB) and Amazon Chronos-2 (456 MB) once, behind a progress screen. They are foundation models trained on large corpora of time series and worth trying on long or unusual histories — but they are not automatically better. On 3–4 years of monthly pharmacy revenue, ARIMA and ETS are usually competitive, and the backtest tells you which won on your data rather than asking you to take anyone's word for it. Everything runs locally on your CPU.

Methods are never mislabelled: a row says "Google TimesFM 2.5" only if that model genuinely produced the numbers. The built-in heuristics are always marked (built-in), and a model that fails to load is reported as "Did not run" rather than being quietly replaced. CI runs both foundation models against real downloaded weights on every release, so an upstream API change fails the build instead of shipping.


Run from source

git clone https://github.com/herbicider/time-series-forecasting-bench.git
cd time-series-forecasting-bench

python3 -m venv venv
source venv/bin/activate          # Windows: venv\Scripts\activate
pip install -r requirements.txt

python shell/app.py               # desktop app
python core/cli.py run samples/monthly_revenue.csv   # headless

Add the AI forecasters (requires Python ≥ 3.10 — both packages declare it, so on 3.9 pip silently refuses and the app stays on the built-in methods):

pip install -r requirements-ai.txt

Build a portable app

pip install pyinstaller
FB_EDITION=ai pyinstaller packaging/forecasting_bench.spec --noconfirm   # or: standard

Output lands in dist/. Windows produces a portable folder, macOS a .app.

Releases ship only the Windows AI build — one download, one filename, so a non-technical user never has to choose. The spec still builds the Standard edition and macOS bundles for anyone running from source; macOS builds are unsigned, and on macOS 15+ they must be allowed via System Settings → Privacy & Security → Open Anyway.

Tests

python -m pytest tests/ -q

Repo layout

core/                    Domain logic — no UI, no web framework
  ingest.py              Paste/CSV/XLSX parsing, format sniffing, validation
  models/                Forecasters + the capability manager
  backtest.py            Rolling-origin evaluation
  conformal.py           Split-conformal interval calibration
  report.py              Verdict generation, CSV/PDF export
service/main.py          Local FastAPI service (job queue, progress, exports)
ui/                      Static HTML/CSS/JS + vendored ECharts and fonts
shell/app.py             pywebview desktop window
packaging/               PyInstaller spec (both platforms, both editions)
                         + START-HERE.txt shipped inside the download
samples/                 Pharmacy example datasets
tests/                   pytest suite

About

Built by Kevin Xing — pharmacy operations & business optimization consulting.

If you'd like to talk through what your numbers mean for your pharmacy — staffing, purchasing, inventory, or growth — send me a message on LinkedIn.


License

Apache 2.0. Third-party attributions in NOTICE.

About

Forecast your pharmacy's numbers and find out which forecast to trust. Seven methods, honest rolling backtest, plain-English verdict. Runs offline on your own computer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages