Introduction to TimesFM
TimesFM, short for Time Series Foundation Model, is an advanced pretrained model specially designed by Google Research for time-series forecasting. This tool prioritizes the analysis and prediction of sequences of data points, spanning varying time intervals, making it an ideal choice for businesses and researchers looking to extract meaningful insights from temporal data.
Overview
At its core, TimesFM shines in its ability to handle univariate time series forecasting, offering comprehensive predictions based on historical data trends. Although it mainly focuses on point forecasts—which predict precise future values—it has some experimental capabilities for quantile forecasts, although these are not fully calibrated. Committed to improving accessibility, TimesFM provides users with the necessary code and resources to load public checkpoints and perform model inferences with ease.
Key Features
Model Specifications
- Flexibility in Forecasting: TimesFM accommodates context lengths up to 512 timepoints and allows for any horizon lengths, provided both the context and horizon maintain a consistent frequency.
- Compatibility: The model requires a contiguous sequence of input data, meaning there should be no gaps in the time series.
System Requirements
For optimal performance, Google Research recommends a system with at least 16GB of RAM to efficiently manage TimesFM’s dependencies.
Updates and Improvements
Through ongoing development efforts, TimesFM has achieved full support for PyTorch, simplifying installation with a one-liner command: pip install timesfm
. Additionally, users can now finetune the pretrained model to better suit specific datasets and make use of zero-shot covariate support with external regressors.
Installation
Installing TimesFM can be accomplished locally using tools like Poetry and Pyenv, which facilitate managing different Python environments. The installation varies based on whether users opt for the PAX or PyTorch version, each requiring specific Python versions. For those focused on the Apple silicon compatibility or lack thereof, the PAX version currently faces challenges which are being addressed.
General Steps
- PAX Version: Requires Python 3.10.x.
- PyTorch Version: Supports Python versions greater than or equal to 3.11.x.
Usage
Once installed, users can efficiently load a model checkpoint through the provided API, which supports both PAX and Torch backends. The model allows for flexible inference based on input arrays or dataframes, requiring only the time series data and their frequencies to generate forecasts.
TimesFM smartly handles different time series frequencies by assigning them a categorical indicator:
- 0: High frequency (up to daily granularity).
- 1: Medium frequency (weekly/monthly).
- 2: Low frequency (quarterly/yearly).
Covariate Support
New enhancements include handling external regressors that enhance the predictive performance of static and dynamic covariates. For instance, businesses can input various factors affecting sales, like promotions or seasonal conditions, to refine forecast accuracy.
Benchmarks and Performance
TimesFM's capabilities have been rigorously tested against extended and long horizon benchmarks, with detailed result tables available for review. These benchmarks attest to the model's robustness in varied forecasting scenarios.
Finetuning and Customization
With TimesFM, users can finetune the model to better fit their unique datasets. This adaptability is pivotal for tailoring the tool to specific applications, whether for academic research or business forecasts.
Contribution and Development
Google invites contributions to the TimesFM project, encouraging adherence to structured coding standards. For formatting, contributors are advised to use yapf
, ensuring consistent code styling aligned with Google’s guidelines.
Conclusion
TimesFM emerges as a powerful tool in the realm of time-series forecasting, underpinned by its adaptability, ease of use, and compatibility with pivotal machine learning infrastructure like PyTorch. As it continues to evolve, TimesFM is set to further empower data-driven decision-making across industries.