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.

MoiraiBaseHyperparams

moirai_base_model.MoiraiBaseHyperparams · inherits PydanticBaseModel

(No description provided.)

__init__(self, ...)

(Inherited from PydanticBaseModel.)

MoiraiBaseModel

moirai_base_model.MoiraiBaseModel · inherits BaseModel

(No detailed summary provided in the class docstring.)

__init__(self, params, settings)

Initialize Moirai 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, y_target, timestamps_context, timestamps_target, x_context=None, x_target=None, **kwargs) -> MoiraiBaseModel

"Train" the Moirai model (no training required for foundation models).

Parameter Type Default Description
y_context np.ndarray - Past target values (not used for training, for compatibility)
y_target np.ndarray - Future target values (not used for training, for compatibility)
timestamps_context np.ndarray - Timestamps for y_context (not used)
timestamps_target np.ndarray - Timestamps for y_target (not used)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - Additional keyword arguments

Returns: Self (The fitted model instance (for compatibility)).

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

Make predictions using the Moirai model.

Parameter Type Default Description
y_context np.ndarray - Recent/past target values, shape (context_steps, num_targets)
timestamps_context np.ndarray - Timestamps for y_context (not used for prediction)
timestamps_target np.ndarray - Timestamps for the prediction horizon (used to determine forecast length)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - Additional keyword arguments (expected to contain freq: Frequency string)

Returns: np.ndarray (Model prediction samples with shape (num_samples, forecast_horizon, num_targets)). Raises: ValueError (If model is not fitted, freq is not provided, or forecast length cannot be determined).