Forecast Using Kumo
!UV_CONSTRAINT= UV_BUILD_CONSTRAINT= uv pip install -q "foundationforecast[plot]"
foundationforecast ships a Kumo class for NVIDIA's Kumo-Forecast model (Kumo-TS):
| Checkpoint | repo_id |
Parameters | Context | Native horizon |
|---|---|---|---|---|
| Kumo-Forecast (default) | nvidia/Kumo-Forecast |
~340M | 512 | 72 |
Kumo-Forecast is a MOMENT-style T5 encoder with a linear forecasting head. A few things to know:
- Series shorter than 512 observations are left-padded and masked; longer series are truncated to their last 512 values. Missing values are masked too.
- Horizons beyond 72 steps are produced by feeding the forecast back as context (autoregressive rollout).
- It produces point forecasts only. There is no native quantile head, so
levelandquantilesneed conformal intervals (see below).
The model runs through the timecopilot-kumo-forecast package, an inference-only packaging of the upstream code.
Import libraries
import pandas as pd
from foundationforecast import ConformalIntervals, FoundationForecast
Load the dataset
The DataFrame must include at least the following columns:
- unique_id: Unique identifier for each time series (string)
- ds: Date column (datetime format)
- y: Target variable for forecasting (float format)
The pandas frequency will be inferred from the ds column, if not provided. If the seasonality is not provided, it will be inferred based on the frequency. If the horizon is not set, it will default to 2 times the inferred seasonality.
df = pd.read_parquet(
"https://timecopilot.s3.amazonaws.com/public/data/m4-hourly.parquet"
)
df = df[df["unique_id"].isin(df["unique_id"].unique()[:8])]
df.head()
| unique_id | ds | y | |
|---|---|---|---|
| 0 | H1 | 2000-01-01 00:00:00 | 605.0 |
| 1 | H1 | 2000-01-01 01:00:00 | 586.0 |
| 2 | H1 | 2000-01-01 02:00:00 | 586.0 |
| 3 | H1 | 2000-01-01 03:00:00 | 559.0 |
| 4 | H1 | 2000-01-01 04:00:00 | 511.0 |
Plot the data
FoundationForecast.plot(df, max_insample_length=48 * 3, plot_random=False)

Import the models
from foundationforecast.models import Kumo
Create a FoundationForecast
models = [
Kumo(alias="Kumo"),
]
ff = FoundationForecast(models=models)
Generate forecast
You can optionally specify the following parameters:
- freq: The frequency of your data (e.g., 'D' for daily, 'M' for monthly)
- h: The forecast horizon, which is the number of periods to predict
- seasonality: The seasonal period of your data, which can be inferred if not provided
h = 48
fcst_df = ff.forecast(df=df, h=h)
fcst_df.head()
| unique_id | ds | Kumo | |
|---|---|---|---|
| 0 | H1 | 2000-02-01 04:00:00 | 619.416809 |
| 1 | H1 | 2000-02-01 05:00:00 | 579.589050 |
| 2 | H1 | 2000-02-01 06:00:00 | 532.249451 |
| 3 | H1 | 2000-02-01 07:00:00 | 500.108124 |
| 4 | H1 | 2000-02-01 08:00:00 | 483.022736 |
ff.plot(df, fcst_df, max_insample_length=48 * 3, plot_random=False)

Prediction intervals
Since Kumo has no native quantiles, asking for level or quantiles raises an error instead of returning made-up intervals:
try:
ff.forecast(df=df, h=h, level=[80])
except ValueError as err:
print(err)
Kumo produces point forecasts only, so `level` and `quantiles` need conformal intervals: create the model with `prediction_intervals=ConformalIntervals(...)`.
Pass prediction_intervals=ConformalIntervals(...) to calibrate the intervals from the cross-validation errors of Kumo's own point forecast. See Conformal prediction for the details.
ff_conformal = FoundationForecast(
models=[
Kumo(
alias="Kumo-CF",
prediction_intervals=ConformalIntervals(n_windows=10),
)
]
)
level = [80, 95]
fcst_cf_df = ff_conformal.forecast(df=df, h=h, level=level)
fcst_cf_df.head()
| unique_id | ds | Kumo-CF | Kumo-CF-lo-95 | Kumo-CF-lo-80 | Kumo-CF-hi-80 | Kumo-CF-hi-95 | |
|---|---|---|---|---|---|---|---|
| 0 | H1 | 2000-02-01 04:00:00 | 619.416809 | 567.620680 | 582.082135 | 656.751483 | 671.212938 |
| 1 | H1 | 2000-02-01 05:00:00 | 579.589050 | 500.423973 | 510.300989 | 648.877112 | 658.754128 |
| 2 | H1 | 2000-02-01 06:00:00 | 532.249451 | 442.370419 | 450.003894 | 614.495007 | 622.128482 |
| 3 | H1 | 2000-02-01 07:00:00 | 500.108124 | 383.297871 | 404.205151 | 596.011096 | 616.918376 |
| 4 | H1 | 2000-02-01 08:00:00 | 483.022736 | 377.349193 | 399.527966 | 566.517505 | 588.696278 |
ff_conformal.plot(
df,
fcst_cf_df,
level=level,
max_insample_length=48 * 3,
plot_random=False,
)

Cross validation
cross_validation() recalibrates the conformal intervals at every cutoff using only data before it.
cv_df = ff_conformal.cross_validation(df=df, h=h, n_windows=2, level=level)
cv_df.head()
| unique_id | ds | cutoff | y | Kumo-CF | Kumo-CF-lo-95 | Kumo-CF-lo-80 | Kumo-CF-hi-80 | Kumo-CF-hi-95 | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | H1 | 2000-01-28 04:00:00 | 2000-01-28 03:00:00 | 664.0 | 672.072571 | 587.410301 | 609.598944 | 734.546198 | 756.734840 |
| 1 | H1 | 2000-01-28 05:00:00 | 2000-01-28 03:00:00 | 550.0 | 616.049194 | 496.174576 | 531.703729 | 700.394659 | 735.923813 |
| 2 | H1 | 2000-01-28 06:00:00 | 2000-01-28 03:00:00 | 544.0 | 547.845154 | 396.197713 | 449.075574 | 646.614734 | 699.492595 |
| 3 | H1 | 2000-01-28 07:00:00 | 2000-01-28 03:00:00 | 505.0 | 506.039062 | 306.512369 | 365.893994 | 646.184131 | 705.565756 |
| 4 | H1 | 2000-01-28 08:00:00 | 2000-01-28 03:00:00 | 483.0 | 484.593384 | 321.601605 | 360.767700 | 608.419067 | 647.585162 |
Evaluation
from functools import partial
from utilsforecast.evaluation import evaluate
from utilsforecast.losses import coverage, mase, scaled_crps
eval_df = evaluate(
cv_df.drop(columns=["cutoff"]),
train_df=df,
metrics=[partial(mase, seasonality=24), scaled_crps, coverage],
level=level,
)
eval_df.groupby("metric").mean(numeric_only=True).T.round(3)
| metric | coverage_level80 | coverage_level95 | mase | scaled_crps |
|---|---|---|---|---|
| Kumo-CF | 0.865 | 0.941 | 0.883 | 0.027 |