Back to models
Forecaster

MIRAForecaster

Zero-shot forecaster wrapping Microsoft MIRA via vendored sktime.libs.mira.

MIRA is a foundation model for medical time series, supporting zero-shot forecasting on irregularly sampled clinical signals via continuous-time rotary positional encoding and neural ODE extrapolation.

Univariate only. Inference follows the autoregressive loop in the official MIRA repository [2].

Quickstart

python
from sktime.forecasting.mira import MIRAForecaster

estimator = MIRAForecaster(model_path: str='MIRA-Mode/MIRA', revision: str='main', config: dict | None=None, context_length: int | None=None, time_alpha: float=1.0, time_snap_step: float=0.1)

Parameters(6)

model_pathstr, default=”MIRA-Mode/MIRA”
Hugging Face model id or local path.
revisionstr, default=”main”
Model revision on the Hugging Face Hub.
configdict, optional, default=None

Extra kwargs for MIRAForPrediction.from_pretrained.

context_lengthint, optional, default=None

Number of history steps passed to the model. If None, uses the full series seen at predict time.

time_alphafloat, default=1.0

alpha used for CT-RoPE normalization of time values.

time_snap_stepfloat, default=0.1

snap_step used for CT-RoPE normalization of time values.

Examples

>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.mira import MIRAForecaster
>>> from sktime.split import temporal_train_test_split
>>> y = load_airline ()
>>> y_train, _ = temporal_train_test_split (y)
>>> f = MIRAForecaster ()
>>> f. fit (y_train)
>>> y_pred = f. predict (fh = [1, 2, 3 ])

References