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.

TimesfmHyperparams

timesfm_model.TimesfmHyperparams · inherits PydanticBaseModel

(No summary provided)

TimesfmModel

timesfm_model.TimesfmModel · inherits BaseModel

(No summary provided)

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

Initialize TimesFM model.

Parameter Type Default Description
params Dict[str, Any] - Model parameters dictionary
settings Dict[str, Any] - Settings dictionary containing device, python_version, etc.

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) -> TimesfmModel

Foundation model: no training needed. Mark as fitted and return self.

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: TimesfmModel (Self)

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)

Make predictions using the trained TimesFM model.

If covariates (x_context and x_target) are provided, uses forecast_with_covariates to incorporate exogenous features.

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 (The predictions.) Raises: ValueError (If TimesFMModel is not fitted.)