Skip to main content
forecast predicts a value forward in time from its history. There is no fit step: the history you pass is the context, exactly like fit/predict for tables.

One series

Pass a DataFrame with a time column and the value to forecast, and say how many steps ahead you want.
from hollerith import Hollerith

h = Hollerith()
result = h.forecast(sales, timestamp="week", target="units", prediction_length=12)

result.head(2)
#                       mean   0.1   0.5   0.9
# timestamp
# 2026-07-06            41.2  33.0  41.0  50.1
# 2026-07-13            43.8  34.9  43.5  53.6
The result is indexed by time, with a mean column and one column per quantile. Quantiles default to 0.1, 0.5, and 0.9; pass quantiles=[...] to change them. The interval columns are how you turn a forecast into a decision: order to the 0.5, hold safety stock to the 0.9.

Many series at once

Pass item_id= to forecast every series in one call, for example all SKUs.
result = h.forecast(
    sales, timestamp="week", target="units", item_id="sku", prediction_length=12
)
result.loc["SKU-1042"]    # one SKU's forecast
The result is indexed by (item_id, timestamp). New SKUs with short histories work: the model forecasts in context across everything you pass it.

Known future covariates

If you know things about the future, like planned promotions or prices, pass them in a future frame instead of prediction_length. Any column in the history that is not the timestamp, target, or item id is a covariate, and future must carry the same columns over the horizon.
future = pd.DataFrame({
    "week": ["2026-07-06", "2026-07-13"],
    "promo": [1, 0],
})
result = h.forecast(sales, timestamp="week", target="units", future=future)

Good to know

  • Ephemeral data. The history and the forecast are purged once the job finishes, the same as predict.
  • Missing values in the history are handled automatically.
  • Provide exactly one of prediction_length or future.