← ClaudeAtlas

anofox-forecast-backtestlisted

Backtesting, cross-validation, evaluation metrics, and conformal prediction intervals for the anofox_forecast DuckDB extension. Use when evaluating forecast accuracy, comparing models with time-series-aware CV, computing metrics (MAE / RMSE / MAPE / MASE / coverage), or attaching distribution-free prediction intervals to forecasts.
DataZooDE/anofox-forecast · ★ 35 · Testing & QA · score 74
Install: claude install-skill DataZooDE/anofox-forecast
# Anofox Forecast — Backtesting, CV, Metrics & Conformal Cheat Sheet **Extension:** `anofox_forecast` v0.15.3 | **DuckDB:** v1.4.5 LTS / v1.5.4+ | **Dual naming:** `ts_*` and `anofox_fcst_ts_*` Time-series-aware cross-validation, error metrics, and distribution-free intervals. ## Critical gotchas - **`ts_backtest_auto_by` was REMOVED.** Use the two-step CV workflow (`ts_cv_folds_by` → `ts_cv_forecast_by`) instead. Older docs and tests may still reference the retired one-liner. - **Metric `_by` table macros (`ts_mae_by`, `ts_rmse_by`, …) are deprecated.** They're ~2400× slower than the scalar + `GROUP BY` pattern and don't parallelise. Use scalars. - **Always `ORDER BY` inside `LIST()`** for temporal correctness: `LIST(y ORDER BY ds)`, not `LIST(y)`. - **`ts_cv_forecast_by` output renames the target column to `y`** (canonical). Don't try to access the original name. - **Folds must be pre-computed before forecasting.** Passing raw data to `ts_cv_forecast_by` throws a clear error. ## The CV two-step workflow (standard) ```sql -- Step 1: Create fold table (train/test rows with actual dates) CREATE OR REPLACE TABLE cv_folds AS SELECT * FROM ts_cv_folds_by('data', unique_id, ds, y, 3, -- n_folds 12, -- horizon per fold MAP{}); -- optional params -- Step 2: Forecast per fold's train set, predict its test set CREATE OR REPLACE TABLE cv_forecasts AS SELECT * FROM ts_cv_forecast_by('cv_folds', unique_id, ds, y, 'AutoET