Back to models
Forecaster

TimeMoEForecaster

Interface for TimeMOE forecaster for zero-shot forecasting.

Quickstart

python
from sktime.forecasting.timemoe import TimeMoEForecaster

estimator = TimeMoEForecaster(model_path: str, config: dict=None, seed: int=None, use_source_package: bool=False, ignore_deps: bool=False)

Parameters(5)

model_path: str

Path to the TimeMOE model. This can be:

  • A model ID from the HuggingFace Hub, e.g., “Maple728/TimeMoE-50M”

  • A local directory containing the model files, specified as an absolute or relative path to the current working directory The path should point to a directory containing the model weights and configuration files in the format expected by the HuggingFace Transformers library.

config: dict, optional

A dictionary specifying the configuration of the TimeMOE model. The available configuration options include hyperparameters that control the prediction behavior, sampling, and hardware utilization.

  • input_size: int, default=1

    The size of the input time series.

seed: int, optional (default=None)
Seed for reproducibility.
use_source_package: bool, optional (default=False)

If True, the model will be loaded directly from the source package TimeMoE. This is useful if you want to bypass the local version of the package or when working in an environment where the latest updates from the source package are needed. If False, the model will be loaded from the local version of package maintained in sktime. To install the source package, follow the instructions here [1].

ignore_deps: bool, optional, default=False
If True, dependency checks will be ignored, and the user is expected to handle the installation of required packages manually. If False, the class will enforce the default dependencies required for Chronos.

Examples

>>> from sktime.forecasting.timemoe import TimeMoEForecaster
>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.model_selection import temporal_train_test_split
>>> y = load_airline ()
>>> y_train, y_test = temporal_train_test_split (y, test_size = 5)
>>> forecaster = TimeMoEForecaster ("Maple728/TimeMoE-50M")
>>> forecaster. fit (y_train) TimeMoEForecaster(model_path='Maple728/TimeMoE-50M')
>>> y_pred = forecaster. predict (fh = [1, 2, 3 ], y = y_test)

References

  1. [1 ] https://github.com/Time-MoE/Time-MoE [2 ] (1, 2) Xiaoming Shi, Shiyu Wang, Yuqi Nie, Dianqi Li, Zhou Ye and others Time-MoE: Billion-Scale Time Series Foundation Models with Mixture of Experts