Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

Timesfm500mModel

chronax.models.timesfm_500m_model.Timesfm500mModel · inherits BaseModel

TimesFM 2.0 500M foundation model wrapper. Uses timesfm.TimesFm with google/timesfm-2.0-500m-pytorch. Returns stochastic samples from experimental quantile forecasts.

__init__(self, params: Dict[str, Any], settings: Dict[str, Any])

Parameter Type Default Description
params Dict[str, Any] - (undocumented)
settings Dict[str, Any] - (undocumented)

train(self, y_context: np.ndarray, y_target: np.ndarray, timestamps_context: np.ndarray, timestamps_target: np.ndarray, x_context: Optional[np.ndarray] = None, x_target: Optional[np.ndarray] = None, **kwargs) -> "Timesfm500mModel"

Foundation model: no training needed. Build model and mark as fitted.

Parameter Type Default Description
y_context np.ndarray - (undocumented)
y_target np.ndarray - (undocumented)
timestamps_context np.ndarray - (undocumented)
timestamps_target np.ndarray - (undocumented)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - (undocumented)

Returns: Timesfm500mModel (the fitted model; sets self._model).

predict(self, y_context: np.ndarray, timestamps_context: np.ndarray, timestamps_target: np.ndarray, x_context: Optional[np.ndarray] = None, x_target: Optional[np.ndarray] = None, **kwargs) -> np.ndarray

Make predictions using TimesFM 500M. Returns stochastic samples (num_samples, forecast_horizon, num_targets) from quantile forecasts. Covariates supported via channel concatenation (past-only); covariate channel forecasts are discarded.

Parameter Type Default Description
y_context np.ndarray - (undocumented)
timestamps_context np.ndarray - (undocumented)
timestamps_target np.ndarray - (undocumented)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - (undocumented)

Returns: np.ndarray (stochastic samples: (num_samples, forecast_horizon, num_targets)). Raises: ValueError (if Timesfm500mModel is not fitted).