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.

SundialModel

chronax.models.sundial_model.SundialModel · inherits BaseModel

Sundial diffusion-based foundation model for time series forecasting.

Sundial generates multiple sample trajectories via diffusion, making it a stochastic forecaster. It operates on univariate sequences, so multivariate targets are handled by iterating over each target independently with z-score normalization.

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

Initializes the Sundial model wrapper.

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

Trains the Sundial model by loading the pre-trained Hugging Face model and setting it to evaluation mode.

Parameters:

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: Self (the fitted forecaster).

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

Generates sample trajectories for the forecast horizon using the fitted Sundial model.

Parameters:

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 (An array of predicted samples, typically of shape (num_samples, forecast_horizon, num_targets)).

Raises:

Exception Description
ValueError If train() has not been called prior to prediction.