Skip to content

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

Python

docs: fix swapped xreg_mode descriptions and typo in error message

darkpowerxo54f5405b7da7
diff --git a/src/timesfm/timesfm_2p5/timesfm_2p5_base.py b/src/timesfm/timesfm_2p5/timesfm_2p5_base.py
index 22f0df7..151abcb 100644
--- a/src/timesfm/timesfm_2p5/timesfm_2p5_base.py
+++ b/src/timesfm/timesfm_2p5/timesfm_2p5_base.py
@@ -221,9 +221,10 @@ class TimesFM_2p5:
dynamic_categorical_covariates: A dict of dynamic categorical covariates.
static_numerical_covariates: A dict of static numerical covariates.
static_categorical_covariates: A dict of static categorical covariates.
- xreg_mode: one of "xreg + timesfm" or "timesfm + xreg". "timesfm + xreg"
- fits a model on the residuals of the TimesFM forecast. "xreg + timesfm"
- fits a model on the targets then forecasts on the residuals via TimesFM.
+ xreg_mode: one of "xreg + timesfm" or "timesfm + xreg". "xreg + timesfm"
+ first fits an XReg model on the targets, then uses TimesFM to forecast
+ the residuals. "timesfm + xreg" first runs TimesFM to get a forecast,
+ then fits an XReg model on the residuals of that forecast.
normalize_xreg_target_per_input: whether to normalize the xreg target per
input in the given batch.
ridge: ridge penalty for the linear model.
@@ -285,7 +286,7 @@ class TimesFM_2p5:
if test_lens[-1] > self.forecast_config.max_horizon:
raise ValueError(
- "Forecast horizon length inferred from the dynamic covaraites is longer than the"
+ "Forecast horizon length inferred from the dynamic covariates is longer than the"
f"max_horizon defined in the forecast config: {test_lens[-1]} > {self.forecast_config.max_horizon=}."
)