From 54f5405b7da738bc35751c4e12b48e0beb4930f1 Mon Sep 17 00:00:00 2001 From: darkpowerxo Date: Wed, 8 Apr 2026 14:20:40 -0400 Subject: [PATCH] docs: fix swapped xreg_mode descriptions and typo in error message Apply changes from PR #366 by @cj-wong: - Correct xreg_mode docstring: descriptions for 'xreg + timesfm' and 'timesfm + xreg' were swapped - Fix 'covaraites' -> 'covariates' typo in error message --- src/timesfm/timesfm_2p5/timesfm_2p5_base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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=}." )