GraniteFlowstateHyperparams
granite_flowstate_model.GraniteFlowstateHyperparams · inherits PydanticBaseModel
(No description provided in source.)
GraniteFlowstateModel
granite_flowstate_model.GraniteFlowstateModel · inherits BaseModel
IBM Granite FlowState foundation model wrapper.
Zero-shot stochastic forecasting via the granite-tsfm package. FlowState outputs 9 quantile forecasts (shape: batch, quantiles, horizon, channels) which are converted to pseudo-samples for stochastic metrics.
__init__(self, params, settings)
Initializes the Granite FlowState model wrapper.
| Parameter | Type | Default | Description |
|---|---|---|---|
| params | Dict[str, Any] | - | (undocumented) |
| settings | Dict[str, Any] | - | (undocumented) |
Raises: ImportError if granite-tsfm>=0.3.0 is not installed.
train(self, y_context, y_target, timestamps_context, timestamps_target, x_context=None, x_target=None, **kwargs) -> GraniteFlowstateModel
Loads the pretrained FlowState model.
| 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; sets self.is_fitted = True).
predict(self, y_context, timestamps_context, timestamps_target, x_context=None, x_target=None, **kwargs) -> np.ndarray
Generates stochastic forecasts using the loaded FlowState model.
| 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 (Forecast samples of shape (num_samples, forecast_horizon, num_targets)).
Raises: ValueError if train() has not been called.