Skip to content
Log inGet startedHugging FaceGitHub

Forecasting

Ranges

Every forecast comes with a range of likely values, so you can plan for a bad week as well as a typical one. An 80% interval should contain the actual value about 80% of the time; backtesting checks that on your own data.

Ask for central intervals by width, in percent. The median comes with them:

fc = model.forecast(df, h=7, level=[80, 95])
# columns: unique_id, ds, q2.5, q10, median, q90, q97.5

Or ask for quantile levels directly, any values between 0 and 1:

fc = model.forecast(history, h=24, quantiles=[0.05, 0.5, 0.95]) # (24, 3)
fc = model.forecast(history, h=24, quantiles="all") # (24, 21): every level the model produces

The default is 0.1, 0.5 and 0.9. The model produces 21 levels from 0.01 to 0.99; other levels are interpolated between them. Pass quantiles or level, not both.

  • Arrays: the last axis runs over the levels in increasing order.
  • DataFrames: one column per level, named q and the level in percent (q10, q97.5), with median for 0.5.