siriuz42's picture
Update README.md
26233ff verified
|
raw
history blame
2.21 kB
metadata
license: apache-2.0
library_name: timesfm
pipeline_tag: time-series-forecasting

TimesFM

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

Resources and Technical Documentation:

Authors: Google Research

This checkpoint is not an officially supported Google product. See TimesFM in BigQuery for Google official support.

Checkpoint timesfm-2.5-200m

timesfm-2.5-200m is the third open model checkpoint.

Data

timesfm-2.5-200m is pretrained using

Install

pip install from PyPI coming soon. At this point, please run

git clone https://github.com/google-research/timesfm.git
cd timesfm
pip install -e .

Code Example

import numpy as np
import timesfm
model = timesfm.TimesFM_2p5_200M_torch()
model.load_checkpoint()
model.compile(
    timesfm.ForecastConfig(
        max_context=1024,
        max_horizon=256,
        normalize_inputs=True,
        use_continuous_quantile_head=True,
        force_flip_invariance=True,
        infer_is_positive=True,
        fix_quantile_crossing=True,
    )
)
point_forecast, quantile_forecast = model.forecast(
    horizon=12,
    inputs=[
        np.linspace(0, 1, 100),
        np.sin(np.linspace(0, 20, 67)),
    ],  # Two dummy inputs
)
point_forecast.shape  # (2, 12)
quantile_forecast.shape  # (2, 12, 10): mean, then 10th to 90th quantiles.