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
This commit is contained in:
darkpowerxo
2026-04-08 14:20:40 -04:00
parent 13a8eb2a25
commit 54f5405b7d
+5 -4
View File
@@ -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=}."
)