tirex icon indicating copy to clipboard operation
tirex copied to clipboard

Undocumented prediction_length threshold

Open febner opened this issue 5 months ago • 1 comments

Thanks for you work, really enjoying it 🤩

One thing I was wondering though, if I turn up the prediction_length to > 2048, the prediction drops to something close to 0.

MRE:

import pandas as pd
import numpy as np
from tirex import load_model
from tirex.util import plot_forecast

# load a TiRex model (automatically fetching the weights from HuggingFace)
model = load_model("NX-AI/TiRex")

# load example data and split into context (to be learnt from) and future values
data_base_url = "https://raw.githubusercontent.com/NX-AI/tirex/refs/heads/main/tests/data/"

# short horizon example: air passengers per month
ctx_s, future_s = np.split(pd.read_csv(f"{data_base_url}/loop_seattle_5T.csv").values.reshape(-1), [-59])

prediction_length = 2500

quantiles_s, mean_s = model.forecast(ctx_s, prediction_length=prediction_length)

print(f"Short series (number of air passengers per month): {prediction_length}")
plot_forecast(context=ctx_s, ground_truth=future_s, forecasts=quantiles_s[0])
Image

Guess it's an edgy benchmark case after all - just couldn't find any docs about that behavior.

febner avatar Nov 18 '25 10:11 febner

Hi! Thx for the catch! This is actually the current max. prediction length of TiRex. We are actively working on a long context version, which should allow for respective longer forecasts. For now if you really need to forecast longer horizons you could for example try to downsample your time series. We will update the documentation asap.

lukfischer avatar Nov 20 '25 12:11 lukfischer

We now mention this limitation in our FAQs.

Tigxy avatar Dec 15 '25 10:12 Tigxy