From 3ef021a837a4b51fe73e8769e46da8961d8cc2fc Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 11:08:23 +0000 Subject: [PATCH 01/18] Update README --- README.md | 46 ++++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 366b50b2..ae892538 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,12 @@
-๐Ÿ”ฅ Chronos-2 is coming soon ๐Ÿ”ฅ - -# Chronos: Learning the Language of Time Series +# Chronos: Pretrained Models for Forecasting [![preprint](https://img.shields.io/static/v1?label=arXiv&message=2403.07815&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2403.07815) -[![huggingface](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Datasets-FFD21E)](https://huggingface.co/datasets/autogluon/chronos_datasets) -[![huggingface](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-FFD21E)](https://huggingface.co/collections/amazon/chronos-models-65f1791d630a8d57cb718444) +[![preprint](https://img.shields.io/static/v1?label=arXiv&message=2510.15821&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2510.15821) +[![huggingface](https://img.shields.io/badge/%F0%9F%A4%97%20HF-Datasets-FFD21E)](https://huggingface.co/datasets/autogluon/chronos_datasets) +[![huggingface](https://img.shields.io/badge/%F0%9F%A4%97%20HF-Models-FFD21E)](https://huggingface.co/collections/amazon/chronos-models-65f1791d630a8d57cb718444) [![fev](https://img.shields.io/static/v1?label=fev&message=Benchmark&color=B31B1B&logo=github)](https://github.com/autogluon/fev) [![aws](https://img.shields.io/static/v1?label=SageMaker&message=Deploy&color=FF9900&logo=amazon-web-services)](notebooks/deploy-chronos-bolt-to-amazon-sagemaker.ipynb) [![faq](https://img.shields.io/badge/FAQ-Questions%3F-blue)](https://github.com/amazon-science/chronos-forecasting/issues?q=is%3Aissue+label%3AFAQ) @@ -20,15 +19,10 @@ ## ๐Ÿš€ News +- **20 Oct 2025**: ๐Ÿš€ [Chronos-2](https://arxiv.org/abs/2510.15821) released. It offers _zero-shot_ support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 achieves the best performance on fev-bench, GIFT-Eval and Chronos Benchmark II amongst pretrained models. Check out [this notebook]() to get started with Chronos-2. - **14 Feb 2025**: ๐Ÿš€ Chronos-Bolt is now available on Amazon SageMaker JumpStart! Check out the [tutorial notebook](notebooks/deploy-chronos-bolt-to-amazon-sagemaker.ipynb) to learn how to deploy Chronos endpoints for production use in 3 lines of code. - **12 Dec 2024**: ๐Ÿ“Š We released [`fev`](https://github.com/autogluon/fev), a lightweight package for benchmarking time series forecasting models based on the [Hugging Face `datasets`](https://huggingface.co/docs/datasets/en/index) library. - **26 Nov 2024**: โšก๏ธ Chronos-Bolt models released [on HuggingFace](https://huggingface.co/collections/amazon/chronos-models-65f1791d630a8d57cb718444). Chronos-Bolt models are more accurate (5% lower error), up to 250x faster and 20x more memory efficient than the original Chronos models of the same size! -- **27 Jun 2024**: ๐Ÿš€ [Released datasets](https://huggingface.co/datasets/autogluon/chronos_datasets) used in the paper and an [evaluation script](./scripts/README.md#evaluating-chronos-models) to compute the WQL and MASE scores reported in the paper. -- **17 May 2024**: ๐Ÿ› Fixed an off-by-one error in bin indices in the `output_transform`. This simple fix significantly improves the overall performance of Chronos. We will update the results in the next revision on ArXiv. -- **10 May 2024**: ๐Ÿš€ We added the code for pretraining and fine-tuning Chronos models. You can find it in [this folder](./scripts/training). We also added [a script](./scripts/kernel-synth.py) for generating synthetic time series data from Gaussian processes (KernelSynth; see Section 4.2 in the paper for details). Check out the [usage examples](./scripts/). -- **19 Apr 2024**: ๐Ÿš€ Chronos is now supported on [AutoGluon-TimeSeries](https://auto.gluon.ai/stable/tutorials/timeseries/index.html), the powerful AutoML package for time series forecasting which enables model ensembles, cloud deployments, and much more. Get started with the [tutorial](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html). -- **08 Apr 2024**: ๐Ÿงช Experimental [MLX inference support](https://github.com/amazon-science/chronos-forecasting/tree/mlx) added. If you have an Apple Silicon Mac, you can now obtain significantly faster forecasts from Chronos compared to CPU inference. This provides an alternative way to exploit the GPU on your Apple Silicon Macs together with the "mps" support in PyTorch. -- **25 Mar 2024**: ๐Ÿš€ [v1.1.0 released](https://github.com/amazon-science/chronos-forecasting/releases/tag/v1.1.0) with inference optimizations and `pipeline.embed` to extract encoder embeddings from Chronos. - **13 Mar 2024**: ๐Ÿš€ Chronos [paper](https://arxiv.org/abs/2403.07815) and inference code released. ## โœจ Introduction @@ -187,29 +181,9 @@ Scripts for pretraining, fine-tuning and evaluating Chronos models can be found Datasets used in the Chronos paper for pretraining and evaluation (both in-domain and zero-shot) are available through the HuggingFace repos: [`autogluon/chronos_datasets`](https://huggingface.co/datasets/autogluon/chronos_datasets) and [`autogluon/chronos_datasets_extra`](https://huggingface.co/datasets/autogluon/chronos_datasets_extra). Check out these repos for instructions on how to download and use the datasets. -## ๐Ÿ”ฅ Coverage - -- [Adapting language model architectures for time series forecasting](https://www.amazon.science/blog/adapting-language-model-architectures-for-time-series-forecasting) (Amazon Science blog post) -- [Amazon AI Researchers Introduce Chronos: A New Machine Learning Framework for Pretrained Probabilistic Time Series Models](https://www.marktechpost.com/2024/03/15/amazon-ai-researchers-introduce-chronos-a-new-machine-learning-framework-for-pretrained-probabilistic-time-series-models/) (Marktechpost blog post) -- [Chronos: The Rise of Foundation Models for Time Series Forecasting](https://towardsdatascience.com/chronos-the-rise-of-foundation-models-for-time-series-forecasting-aaeba62d9da3) (Towards Data Science blog post by Luรญs Roque and Rafael Guedes) -- [Moirai: Time Series Foundation Models for Universal Forecasting](https://towardsdatascience.com/moirai-time-series-foundation-models-for-universal-forecasting-dc93f74b330f) (Towards Data Science blog post by Luรญs Roque and Rafael Guedes, includes comparison of Chronos with Moirai) -- [Chronos: The Latest Time Series Forecasting Foundation Model by Amazon](https://towardsdatascience.com/chronos-the-latest-time-series-forecasting-foundation-model-by-amazon-2687d641705a) (Towards Data Science blog post by Marco Peixeiro) - - The original article had a critical bug affecting the metric computation for Chronos. We opened a [pull request](https://github.com/marcopeix/time-series-analysis/pull/10) to fix it. -- [How to Effectively Forecast Time Series with Amazon's New Time Series Forecasting Model](https://towardsdatascience.com/how-to-effectively-forecast-time-series-with-amazons-new-time-series-forecasting-model-9e04d4ccf67e) (Towards Data Science blog post by Eivind Kjosbakken) -- [Chronos: Learning the Language of Time Series](https://minimizeregret.com/linked/2024/03/27/chronos-forecasting/) (Minimize Regret blog post by Tim Radtke) -- [Chronos: Another Zero-Shot Time Series Forecaster LLM](https://levelup.gitconnected.com/chronos-another-zero-shot-time-series-forecaster-llm-0e80753a7ad0) (Level Up Coding blog post by Level Up Coding AI TutorMaster) -- [Paper Review: Chronos: Learning the Language of Time Series](https://andlukyane.com/blog/paper-review-chronos) (Review by Andrey Lukyanenko) -- [Foundation Models for Forecasting: the Future or Folly?](https://insights.radix.ai/blog/foundation-models-for-forecasting-the-future-or-folly) (Blog post by Radix) -- [Learning the Language of Time Series with Chronos](https://medium.com/@ManueleCaddeo/learning-the-language-of-time-series-with-chronos-fea7d0fedde4) (Medium post by Manuele Caddeo) -- [The latest advancement in Time Series Forecasting from AWS: Chronos](https://medium.com/chat-gpt-now-writes-all-my-articles/the-latest-advancement-in-time-series-forecasting-from-aws-chronos-python-code-included-0205d01248f3) (Medium post by Abish Pius) -- [Decoding the Future: How Chronos Redefines Time Series Forecasting with the Art of Language](https://medium.com/@zamalbabar/decoding-the-future-how-chronos-redefines-time-series-forecasting-with-the-art-of-language-cecc2174e400) (Medium post by Zamal) -- [Comparison of Chronos against the SCUM ensemble of statistical models](https://github.com/Nixtla/nixtla/tree/main/experiments/amazon-chronos) (Benchmark by Nixtla) - - We opened a [pull request](https://github.com/Nixtla/nixtla/pull/281) extending the analysis to 28 datasets (200K+ time series) and showing that **zero-shot** Chronos models perform comparably to this strong ensemble of 4 statistical models while being significantly faster on average. Our complete response can be [found here](https://www.linkedin.com/pulse/extended-comparison-chronos-against-statistical-ensemble-ansari-4aste/). -- [Comparison of Chronos against a variety of forecasting models](https://www.linkedin.com/feed/update/urn:li:activity:7178398371815051267/) (Benchmark by ReadyTensor) - ## ๐Ÿ“ Citation -If you find Chronos models useful for your research, please consider citing the associated [paper](https://arxiv.org/abs/2403.07815): +If you find this models useful for your research, please consider citing the associated papers: ``` @article{ansari2024chronos, @@ -220,6 +194,14 @@ If you find Chronos models useful for your research, please consider citing the year={2024}, url={https://openreview.net/forum?id=gerNCVqqtR} } + +@article{ansari2025chronos2, + title = {Chronos-2: From Univariate to Universal Forecasting}, + author = {Abdul Fatir Ansari and Oleksandr Shchur and Jaris Kรผken and Andreas Auer and Boran Han and Pedro Mercado and Syama Sundar Rangapuram and Huibin Shen and Lorenzo Stella and Xiyuan Zhang and Mononito Goswami and Shubham Kapoor and Danielle C. Maddix and Pablo Guerron and Tony Hu and Junming Yin and Nick Erickson and Prateek Mutalik Desai and Hao Wang and Huzefa Rangwala and George Karypis and Yuyang Wang and Michael Bohlke-Schneider}, + journal = {arXiv preprint arXiv:2510.15821}, + year = {2025}, + url = {https://arxiv.org/abs/2510.15821} +} ``` ## ๐Ÿ›ก๏ธ Security From 17a06dea400de91fa7f38cd2148b34029762c1da Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 11:41:44 +0000 Subject: [PATCH 02/18] Update example --- README.md | 120 +++++++++++++++++++++++------------------------------- 1 file changed, 52 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index ae892538..c99eb7a9 100644 --- a/README.md +++ b/README.md @@ -96,41 +96,36 @@ cd chronos-forecasting && pip install --editable ".[training]" ### Forecasting -A minimal example showing how to perform forecasting using Chronos and Chronos-Bolt models: +A minimal example showing how to perform forecasting using Chronos-2: ```python import pandas as pd # requires: pip install pandas -import torch -from chronos import BaseChronosPipeline +from chronos import Chronos2Pipeline -pipeline = BaseChronosPipeline.from_pretrained( - "amazon/chronos-t5-small", # use "amazon/chronos-bolt-small" for the corresponding Chronos-Bolt model - device_map="cuda", # use "cpu" for CPU inference - torch_dtype=torch.bfloat16, -) +pipeline = Chronos2Pipeline.from_pretrained("s3://autogluon/chronos-2", device_map="cuda") -df = pd.read_csv( - "https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv" -) +target = "target" # Column name containing the values to forecast +prediction_length = 24 # Number of steps to forecast ahead +id_column = "id" # Column identifying different time series +timestamp_column = "timestamp" # Column containing datetime information -# context must be either a 1D tensor, a list of 1D tensors, -# or a left-padded 2D tensor with batch as the first dimension -# quantiles is an fp32 tensor with shape [batch_size, prediction_length, num_quantile_levels] -# mean is an fp32 tensor with shape [batch_size, prediction_length] -quantiles, mean = pipeline.predict_quantiles( - context=torch.tensor(df["#Passengers"]), - prediction_length=12, - quantile_levels=[0.1, 0.5, 0.9], -) -``` +# Load historical energy prices and past values of covariates +context_df = pd.read_parquet("s3://autogluon/datasets/timeseries/electricity_price/train.parquet") -For the original Chronos models, `pipeline.predict` can be used to draw forecast samples. More options for `predict_kwargs` in `pipeline.predict_quantiles` can be found with: +# Load future values of covariates +test_df = pd.read_parquet("s3://autogluon/datasets/timeseries/electricity_price/test.parquet") +future_df = test_df.drop(columns=target) -```python -from chronos import ChronosPipeline, ChronosBoltPipeline - -print(ChronosPipeline.predict.__doc__) # for Chronos models -print(ChronosBoltPipeline.predict.__doc__) # for Chronos-Bolt models +# Generate predictions with covariates +pred_df = pipeline.predict_df( + context_df, + future_df=future_df, + prediction_length=prediction_length, + quantile_levels=[0.1, 0.5, 0.9], + id_column=id_column, + timestamp_column=timestamp_column, + target=target, +) ``` We can now visualize the forecast: @@ -138,52 +133,41 @@ We can now visualize the forecast: ```python import matplotlib.pyplot as plt # requires: pip install matplotlib -forecast_index = range(len(df), len(df) + 12) -low, median, high = quantiles[0, :, 0], quantiles[0, :, 1], quantiles[0, :, 2] - -plt.figure(figsize=(8, 4)) -plt.plot(df["#Passengers"], color="royalblue", label="historical data") -plt.plot(forecast_index, median, color="tomato", label="median forecast") -plt.fill_between(forecast_index, low, high, color="tomato", alpha=0.3, label="80% prediction interval") -plt.legend() -plt.grid() -plt.show() -``` - -### Extracting Encoder Embeddings - -A minimal example showing how to extract encoder embeddings from Chronos models: - -```python -import pandas as pd -import torch -from chronos import ChronosPipeline - -pipeline = ChronosPipeline.from_pretrained( - "amazon/chronos-t5-small", - device_map="cuda", - torch_dtype=torch.bfloat16, +timeseries_id = "DE" # Specific time series to visualize +history_length = 256 # The number of historical values to plot + +ts_context = context_df.query(f"{id_column} == @timeseries_id").set_index(timestamp_column)[target] +ts_pred = pred_df.query(f"{id_column} == @timeseries_id and target_name == @target").set_index(timestamp_column)[ + ["0.1", "predictions", "0.9"] +] +ts_ground_truth = test_df.query(f"{id_column} == @timeseries_id").set_index(timestamp_column)[target] + +start_idx = max(0, len(ts_context) - history_length) +plot_cutoff = ts_context.index[start_idx] +ts_context = ts_context[ts_context.index >= plot_cutoff] +ts_ground_truth = ts_ground_truth[ts_ground_truth.index >= plot_cutoff] + +fig = plt.figure(figsize=(12, 3)) +ax = fig.gca() +ts_context.plot(ax=ax, label=f"historical {target}", color="xkcd:azure") +ts_ground_truth.plot(ax=ax, label=f"future {target} (ground truth)", color="xkcd:grass green") +ts_pred["predictions"].plot(ax=ax, label="forecast", color="xkcd:violet") +ax.fill_between( + ts_pred.index, + ts_pred["0.1"], + ts_pred["0.9"], + alpha=0.7, + label="prediction interval", + color="xkcd:light lavender", ) - -df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv") - -# context must be either a 1D tensor, a list of 1D tensors, -# or a left-padded 2D tensor with batch as the first dimension -context = torch.tensor(df["#Passengers"]) -embeddings, tokenizer_state = pipeline.embed(context) +ax.legend(loc="upper left") +ax.set_title(f"{target} forecast for {timeseries_id}") +fig.show() ``` -### Pretraining, fine-tuning and evaluation - -Scripts for pretraining, fine-tuning and evaluating Chronos models can be found in [this folder](./scripts/). - -## :floppy_disk: Datasets - -Datasets used in the Chronos paper for pretraining and evaluation (both in-domain and zero-shot) are available through the HuggingFace repos: [`autogluon/chronos_datasets`](https://huggingface.co/datasets/autogluon/chronos_datasets) and [`autogluon/chronos_datasets_extra`](https://huggingface.co/datasets/autogluon/chronos_datasets_extra). Check out these repos for instructions on how to download and use the datasets. - ## ๐Ÿ“ Citation -If you find this models useful for your research, please consider citing the associated papers: +If you find Chronos models useful for your research, please consider citing the associated papers: ``` @article{ansari2024chronos, From 77c37fa33f0fc7c2e2fc6e272ae82d26cf73393a Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:11:07 +0000 Subject: [PATCH 03/18] Update README --- README.md | 62 ++++++++++++++++++------------------------------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index c99eb7a9..a88a0d7d 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,12 @@ ## โœจ Introduction +This package provides an interface to the Chronos family of **pretrained time series forecasting models** developed by AWS. The following model families are supported by this package. + +- **Chronos**: The original Chronos family which is based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. To learn more about Chronos, check out the [publication](https://openreview.net/forum?id=gerNCVqqtR). +- **Chronos-Bolt**: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future stepsโ€”a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this [blog post](https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/). +- **Chronos-2**: Our latest model with significantly enhanced capabilities. It offers zero-shot support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 delivers state-of-the-art zero-shot performance across multiple benchmarks (including fev-bench and GIFT-Eval), with the largest improvements observed on tasks that include exogenous features. Chronos-2 also achieves a win rate of over 90% against Chronos-Bolt in head-to-head comparisons. To learn more about Chronos, check out the [technical report](https://arxiv.org/abs/2510.15821). + Chronos is a family of **pretrained time series forecasting models** based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. Chronos models have been trained on a large corpus of publicly available time series data, as well as synthetic data generated using Gaussian processes. For details on Chronos models, training data and procedures, and experimental results, please refer to the paper [Chronos: Learning the Language of Time Series](https://arxiv.org/abs/2403.07815). @@ -39,61 +45,33 @@ For details on Chronos models, training data and procedures, and experimental re

-### Architecture - -The models in this repository are based on the [T5 architecture](https://arxiv.org/abs/1910.10683). The only difference is in the vocabulary size: Chronos-T5 models use 4096 different tokens, compared to 32128 of the original T5 models, resulting in fewer parameters. +### Available Models
-| Model | Parameters | Based on | -| ---------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------- | -| [**chronos-t5-tiny**](https://huggingface.co/amazon/chronos-t5-tiny) | 8M | [t5-efficient-tiny](https://huggingface.co/google/t5-efficient-tiny) | -| [**chronos-t5-mini**](https://huggingface.co/amazon/chronos-t5-mini) | 20M | [t5-efficient-mini](https://huggingface.co/google/t5-efficient-mini) | -| [**chronos-t5-small**](https://huggingface.co/amazon/chronos-t5-small) | 46M | [t5-efficient-small](https://huggingface.co/google/t5-efficient-small) | -| [**chronos-t5-base**](https://huggingface.co/amazon/chronos-t5-base) | 200M | [t5-efficient-base](https://huggingface.co/google/t5-efficient-base) | -| [**chronos-t5-large**](https://huggingface.co/amazon/chronos-t5-large) | 710M | [t5-efficient-large](https://huggingface.co/google/t5-efficient-large) | -| [**chronos-bolt-tiny**](https://huggingface.co/amazon/chronos-bolt-tiny) | 9M | [t5-efficient-tiny](https://huggingface.co/google/t5-efficient-tiny) | -| [**chronos-bolt-mini**](https://huggingface.co/amazon/chronos-bolt-mini) | 21M | [t5-efficient-mini](https://huggingface.co/google/t5-efficient-mini) | -| [**chronos-bolt-small**](https://huggingface.co/amazon/chronos-bolt-small) | 48M | [t5-efficient-small](https://huggingface.co/google/t5-efficient-small) | -| [**chronos-bolt-base**](https://huggingface.co/amazon/chronos-bolt-base) | 205M | [t5-efficient-base](https://huggingface.co/google/t5-efficient-base) | +| Model | Parameters | +| ---------------------------------------------------------------------- | ---------- | +| `s3://autogluon/chronos-2` | 120M | +| [`amazon/chronos-bolt-tiny`](https://huggingface.co/amazon/chronos-bolt-tiny) | 9M | +| [`amazon/chronos-bolt-mini`](https://huggingface.co/amazon/chronos-bolt-mini) | 21M | +| [`amazon/chronos-bolt-small`](https://huggingface.co/amazon/chronos-bolt-small) | 48M | +| [`amazon/chronos-bolt-base`](https://huggingface.co/amazon/chronos-bolt-base) | 205M | +| [`amazon/chronos-t5-tiny`](https://huggingface.co/amazon/chronos-t5-tiny) | 8M | +| [`amazon/chronos-t5-mini`](https://huggingface.co/amazon/chronos-t5-mini) | 20M | +| [`amazon/chronos-t5-small`](https://huggingface.co/amazon/chronos-t5-small) | 46M | +| [`amazon/chronos-t5-base`](https://huggingface.co/amazon/chronos-t5-base) | 200M | +| [`amazon/chronos-t5-large`](https://huggingface.co/amazon/chronos-t5-large) | 710M |
-### Zero-Shot Results - -The following figure showcases the remarkable **zero-shot** performance of Chronos and Chronos-Bolt models on 27 datasets against local models, task-specific models and other pretrained models. For details on the evaluation setup and other results, please refer to [the paper](https://arxiv.org/abs/2403.07815). - -

- -
- - Fig. 2: Performance of different models on Benchmark II, comprising 27 datasets not seen by Chronos and Chronos-Bolt models during training. This benchmark provides insights into the zero-shot performance of Chronos and Chronos-Bolt models against local statistical models, which fit parameters individually for each time series, task-specific models trained on each task, and pretrained models trained on a large corpus of time series. Pretrained Models (Other) indicates that some (or all) of the datasets in Benchmark II may have been in the training corpus of these models. The probabilistic (WQL) and point (MASE) forecasting metrics were normalized using the scores of the Seasonal Naive baseline and aggregated through a geometric mean to obtain the Agg. Relative WQL and MASE, respectively. - -

- ## ๐Ÿ“ˆ Usage -To perform inference with Chronos or Chronos-Bolt models, the easiest way is to install this package through `pip`: +To perform inference with Chronos, the easiest way is to install this package through `pip`: ```sh pip install chronos-forecasting ``` -If you're interested in pretraining, fine-tuning, and other research & development, clone and install the package from source: - -```sh -# Clone the repository -git clone https://github.com/amazon-science/chronos-forecasting.git - -# Install in editable mode with extra training-related dependencies -cd chronos-forecasting && pip install --editable ".[training]" -``` - -> [!TIP] -> This repository is intended for research purposes and provides a minimal interface to Chronos models. For reliable production use, we recommend the following options: -> - [AutoGluon](https://auto.gluon.ai) provides effortless fine-tuning, augmenting Chronos models with exogenous information through covariate regressors, ensembling with other statistical and machine learning models. Check out the AutoGluon Chronos [tutorial](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html). -> - SageMaker JumpStart makes it easy to deploy Chronos inference endpoints to AWS with just a few lines of code. Check out [this tutorial](notebooks/deploy-chronos-bolt-to-amazon-sagemaker.ipynb) for more details. - ### Forecasting A minimal example showing how to perform forecasting using Chronos-2: From c8e03cef6baec7046731b7d682df6a57d13967c9 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:14:50 +0000 Subject: [PATCH 04/18] Fix --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a88a0d7d..c8abc536 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ ## โœจ Introduction -This package provides an interface to the Chronos family of **pretrained time series forecasting models** developed by AWS. The following model families are supported by this package. +This package provides an interface to the Chronos family of **pretrained time series forecasting models** developed by AWS. The following model families are supported. - **Chronos**: The original Chronos family which is based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. To learn more about Chronos, check out the [publication](https://openreview.net/forum?id=gerNCVqqtR). - **Chronos-Bolt**: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future stepsโ€”a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this [blog post](https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/). @@ -143,6 +143,12 @@ ax.set_title(f"{target} forecast for {timeseries_id}") fig.show() ``` +## Example Notebooks + +- [Chronos-2 Quick Start](notebooks/chronos-2-quickstart.ipynb) +- [Deploy Chronos-Bolt on Amazon SageMaker](notebooks/deploy-chronos-bolt-to-amazon-sagemaker.ipynb) +- Deploy Chronos-2 on Amazon SageMaker (coming soon!) + ## ๐Ÿ“ Citation If you find Chronos models useful for your research, please consider citing the associated papers: From 882191c678a869b87a0ac217ff6851bcb038e373 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:15:56 +0000 Subject: [PATCH 05/18] Fix notebook link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8abc536..39903a4d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ## ๐Ÿš€ News -- **20 Oct 2025**: ๐Ÿš€ [Chronos-2](https://arxiv.org/abs/2510.15821) released. It offers _zero-shot_ support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 achieves the best performance on fev-bench, GIFT-Eval and Chronos Benchmark II amongst pretrained models. Check out [this notebook]() to get started with Chronos-2. +- **20 Oct 2025**: ๐Ÿš€ [Chronos-2](https://arxiv.org/abs/2510.15821) released. It offers _zero-shot_ support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 achieves the best performance on fev-bench, GIFT-Eval and Chronos Benchmark II amongst pretrained models. Check out [this notebook](notebooks/chronos-2-quickstart.ipynb) to get started with Chronos-2. - **14 Feb 2025**: ๐Ÿš€ Chronos-Bolt is now available on Amazon SageMaker JumpStart! Check out the [tutorial notebook](notebooks/deploy-chronos-bolt-to-amazon-sagemaker.ipynb) to learn how to deploy Chronos endpoints for production use in 3 lines of code. - **12 Dec 2024**: ๐Ÿ“Š We released [`fev`](https://github.com/autogluon/fev), a lightweight package for benchmarking time series forecasting models based on the [Hugging Face `datasets`](https://huggingface.co/docs/datasets/en/index) library. - **26 Nov 2024**: โšก๏ธ Chronos-Bolt models released [on HuggingFace](https://huggingface.co/collections/amazon/chronos-models-65f1791d630a8d57cb718444). Chronos-Bolt models are more accurate (5% lower error), up to 250x faster and 20x more memory efficient than the original Chronos models of the same size! From 2562bfc10cda8070909bc6e4f6fd6e5cbbed11d0 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:33:35 +0000 Subject: [PATCH 06/18] Remove stuff --- README.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/README.md b/README.md index 39903a4d..bfc57e7d 100644 --- a/README.md +++ b/README.md @@ -31,19 +31,7 @@ This package provides an interface to the Chronos family of **pretrained time se - **Chronos**: The original Chronos family which is based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. To learn more about Chronos, check out the [publication](https://openreview.net/forum?id=gerNCVqqtR). - **Chronos-Bolt**: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future stepsโ€”a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this [blog post](https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/). -- **Chronos-2**: Our latest model with significantly enhanced capabilities. It offers zero-shot support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 delivers state-of-the-art zero-shot performance across multiple benchmarks (including fev-bench and GIFT-Eval), with the largest improvements observed on tasks that include exogenous features. Chronos-2 also achieves a win rate of over 90% against Chronos-Bolt in head-to-head comparisons. To learn more about Chronos, check out the [technical report](https://arxiv.org/abs/2510.15821). - -Chronos is a family of **pretrained time series forecasting models** based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. Chronos models have been trained on a large corpus of publicly available time series data, as well as synthetic data generated using Gaussian processes. - -For details on Chronos models, training data and procedures, and experimental results, please refer to the paper [Chronos: Learning the Language of Time Series](https://arxiv.org/abs/2403.07815). - -

- -
- - Fig. 1: High-level depiction of Chronos. (Left) The input time series is scaled and quantized to obtain a sequence of tokens. (Center) The tokens are fed into a language model which may either be an encoder-decoder or a decoder-only model. The model is trained using the cross-entropy loss. (Right) During inference, we autoregressively sample tokens from the model and map them back to numerical values. Multiple trajectories are sampled to obtain a predictive distribution. - -

+- **Chronos-2**: Our latest model with significantly enhanced capabilities. It offers zero-shot support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 delivers state-of-the-art zero-shot performance across multiple benchmarks (including fev-bench and GIFT-Eval), with the largest improvements observed on tasks that include exogenous features. It also achieves a win rate of over 90% against Chronos-Bolt in head-to-head comparisons. To learn more about Chronos, check out the [technical report](https://arxiv.org/abs/2510.15821). ### Available Models From cfa690350e532a274033c0ba37e7d0cac84fc3e0 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:34:54 +0000 Subject: [PATCH 07/18] Update badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bfc57e7d..1d5f3836 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ # Chronos: Pretrained Models for Forecasting -[![preprint](https://img.shields.io/static/v1?label=arXiv&message=2403.07815&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2403.07815) -[![preprint](https://img.shields.io/static/v1?label=arXiv&message=2510.15821&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2510.15821) +[![preprint](https://img.shields.io/static/v1?label=Chronos-Paper&message=2403.07815&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2403.07815) +[![preprint](https://img.shields.io/static/v1?label=Chronos-2-Report&message=2510.15821&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2510.15821) [![huggingface](https://img.shields.io/badge/%F0%9F%A4%97%20HF-Datasets-FFD21E)](https://huggingface.co/datasets/autogluon/chronos_datasets) [![huggingface](https://img.shields.io/badge/%F0%9F%A4%97%20HF-Models-FFD21E)](https://huggingface.co/collections/amazon/chronos-models-65f1791d630a8d57cb718444) [![fev](https://img.shields.io/static/v1?label=fev&message=Benchmark&color=B31B1B&logo=github)](https://github.com/autogluon/fev) From 3eb6b1271459726d5680b299d43cff1358beac1e Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 14:37:56 +0200 Subject: [PATCH 08/18] Update README.md Co-authored-by: Oleksandr Shchur --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d5f3836..e0c7c29c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
-# Chronos: Pretrained Models for Forecasting +# Chronos: Pretrained Models for Time Series Forecasting [![preprint](https://img.shields.io/static/v1?label=Chronos-Paper&message=2403.07815&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2403.07815) [![preprint](https://img.shields.io/static/v1?label=Chronos-2-Report&message=2510.15821&color=B31B1B&logo=arXiv)](https://arxiv.org/abs/2510.15821) From daefb4f007d0cdc69b0991373d9b6041e940d954 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 14:38:28 +0200 Subject: [PATCH 09/18] Update README.md Co-authored-by: Oleksandr Shchur --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0c7c29c..4f234aec 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ id_column = "id" # Column identifying different time series timestamp_column = "timestamp" # Column containing datetime information # Load historical energy prices and past values of covariates -context_df = pd.read_parquet("s3://autogluon/datasets/timeseries/electricity_price/train.parquet") +context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet") # Load future values of covariates test_df = pd.read_parquet("s3://autogluon/datasets/timeseries/electricity_price/test.parquet") From da11bc964bbe28e45c09298c36529a891d5c4ada Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 14:38:36 +0200 Subject: [PATCH 10/18] Update README.md Co-authored-by: Oleksandr Shchur --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f234aec..11b3dc7c 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ timestamp_column = "timestamp" # Column containing datetime information context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet") # Load future values of covariates -test_df = pd.read_parquet("s3://autogluon/datasets/timeseries/electricity_price/test.parquet") +test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet") future_df = test_df.drop(columns=target) # Generate predictions with covariates From be00c59262f09a2e6a59ed3f0f5cd1481440802f Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 14:38:46 +0200 Subject: [PATCH 11/18] Update README.md Co-authored-by: Oleksandr Shchur --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11b3dc7c..9994133e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ ## โœจ Introduction -This package provides an interface to the Chronos family of **pretrained time series forecasting models** developed by AWS. The following model families are supported. +This package provides an interface to the Chronos family of **pretrained time series forecasting models**. The following model families are supported. - **Chronos**: The original Chronos family which is based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. To learn more about Chronos, check out the [publication](https://openreview.net/forum?id=gerNCVqqtR). - **Chronos-Bolt**: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future stepsโ€”a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this [blog post](https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/). From 7abc43cd5758cd505ce748290dfbf4ddc7f0e76f Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:40:09 +0000 Subject: [PATCH 12/18] Reorder --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9994133e..797ec9ea 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ This package provides an interface to the Chronos family of **pretrained time series forecasting models**. The following model families are supported. -- **Chronos**: The original Chronos family which is based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. To learn more about Chronos, check out the [publication](https://openreview.net/forum?id=gerNCVqqtR). -- **Chronos-Bolt**: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future stepsโ€”a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this [blog post](https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/). - **Chronos-2**: Our latest model with significantly enhanced capabilities. It offers zero-shot support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 delivers state-of-the-art zero-shot performance across multiple benchmarks (including fev-bench and GIFT-Eval), with the largest improvements observed on tasks that include exogenous features. It also achieves a win rate of over 90% against Chronos-Bolt in head-to-head comparisons. To learn more about Chronos, check out the [technical report](https://arxiv.org/abs/2510.15821). +- **Chronos-Bolt**: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future stepsโ€”a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this [blog post](https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/). +- **Chronos**: The original Chronos family which is based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. To learn more about Chronos, check out the [publication](https://openreview.net/forum?id=gerNCVqqtR). ### Available Models From 13c846abc9f509b2cdce2e81631be7c840a5a816 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:41:30 +0000 Subject: [PATCH 13/18] Add link to chronos-2 id --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 797ec9ea..e6627597 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ This package provides an interface to the Chronos family of **pretrained time se | Model | Parameters | | ---------------------------------------------------------------------- | ---------- | -| `s3://autogluon/chronos-2` | 120M | +| [`s3://autogluon/chronos-2`](https://arxiv.org/abs/2510.15821) | 120M | | [`amazon/chronos-bolt-tiny`](https://huggingface.co/amazon/chronos-bolt-tiny) | 9M | | [`amazon/chronos-bolt-mini`](https://huggingface.co/amazon/chronos-bolt-mini) | 21M | | [`amazon/chronos-bolt-small`](https://huggingface.co/amazon/chronos-bolt-small) | 48M | From d9893ec8085747c56d58a0ccbbd0a45f35ba4614 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:42:31 +0000 Subject: [PATCH 14/18] Rename col --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6627597..a7021091 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ This package provides an interface to the Chronos family of **pretrained time se
-| Model | Parameters | +| Model ID | Parameters | | ---------------------------------------------------------------------- | ---------- | | [`s3://autogluon/chronos-2`](https://arxiv.org/abs/2510.15821) | 120M | | [`amazon/chronos-bolt-tiny`](https://huggingface.co/amazon/chronos-bolt-tiny) | 9M | From d2fd8cd557dec77a376f4077feec125bdec0bcbd Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:44:50 +0000 Subject: [PATCH 15/18] Update plotting code --- README.md | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index a7021091..a11f2922 100644 --- a/README.md +++ b/README.md @@ -99,26 +99,14 @@ We can now visualize the forecast: ```python import matplotlib.pyplot as plt # requires: pip install matplotlib -timeseries_id = "DE" # Specific time series to visualize -history_length = 256 # The number of historical values to plot - -ts_context = context_df.query(f"{id_column} == @timeseries_id").set_index(timestamp_column)[target] -ts_pred = pred_df.query(f"{id_column} == @timeseries_id and target_name == @target").set_index(timestamp_column)[ - ["0.1", "predictions", "0.9"] -] -ts_ground_truth = test_df.query(f"{id_column} == @timeseries_id").set_index(timestamp_column)[target] - -start_idx = max(0, len(ts_context) - history_length) -plot_cutoff = ts_context.index[start_idx] -ts_context = ts_context[ts_context.index >= plot_cutoff] -ts_ground_truth = ts_ground_truth[ts_ground_truth.index >= plot_cutoff] - -fig = plt.figure(figsize=(12, 3)) -ax = fig.gca() -ts_context.plot(ax=ax, label=f"historical {target}", color="xkcd:azure") -ts_ground_truth.plot(ax=ax, label=f"future {target} (ground truth)", color="xkcd:grass green") -ts_pred["predictions"].plot(ax=ax, label="forecast", color="xkcd:violet") -ax.fill_between( +ts_context = context_df.set_index(timestamp_column)[target].tail(256) +ts_pred = pred_df.set_index(timestamp_column) +ts_ground_truth = test_df.set_index(timestamp_column)[target] + +ts_context.plot(label="historical data", color="xkcd:azure", figsize=(12, 3)) +ts_ground_truth.plot(label="future data (ground truth)", color="xkcd:grass green") +ts_pred["predictions"].plot(label="forecast", color="xkcd:violet") +plt.fill_between( ts_pred.index, ts_pred["0.1"], ts_pred["0.9"], @@ -126,9 +114,7 @@ ax.fill_between( label="prediction interval", color="xkcd:light lavender", ) -ax.legend(loc="upper left") -ax.set_title(f"{target} forecast for {timeseries_id}") -fig.show() +plt.legend() ``` ## Example Notebooks From 02fb392a33bc7790b7fe435d0105d1d597148341 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:45:57 +0000 Subject: [PATCH 16/18] Fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a11f2922..2f18f3c2 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ ## โœจ Introduction -This package provides an interface to the Chronos family of **pretrained time series forecasting models**. The following model families are supported. +This package provides an interface to the Chronos family of **pretrained time series forecasting models**. The following model types are supported. - **Chronos-2**: Our latest model with significantly enhanced capabilities. It offers zero-shot support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 delivers state-of-the-art zero-shot performance across multiple benchmarks (including fev-bench and GIFT-Eval), with the largest improvements observed on tasks that include exogenous features. It also achieves a win rate of over 90% against Chronos-Bolt in head-to-head comparisons. To learn more about Chronos, check out the [technical report](https://arxiv.org/abs/2510.15821). - **Chronos-Bolt**: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future stepsโ€”a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this [blog post](https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/). From f23330083870e86e3a843143d3bed6c6f18b575f Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:50:23 +0000 Subject: [PATCH 17/18] Add context length comparison in notebook --- notebooks/chronos-2-quickstart.ipynb | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/notebooks/chronos-2-quickstart.ipynb b/notebooks/chronos-2-quickstart.ipynb index 730b468a..ac57e792 100644 --- a/notebooks/chronos-2-quickstart.ipynb +++ b/notebooks/chronos-2-quickstart.ipynb @@ -17,6 +17,7 @@ "| Past-only (real/categorical) covariates | โŒ | โŒ | โœ… |\n", "| Known future (real/categorical) covariates | ๐Ÿงฉ | ๐Ÿงฉ | โœ… |\n", "| Fine-tuning support | โœ… | โœ… | โœ… |\n", + "| Max. Context Length | 512 | 2048 | 8192 |\n", "\n", "๐Ÿงฉ Chronos/Chronos-Bolt do not natively support future covariates, but they can be combined with external covariate regressors (see [AutoGluon tutorial](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html#incorporating-the-covariates)). This only models per-timestep effects, not effects across time. In contrast, Chronos-2 supports all covariate types natively.\n", "\n", @@ -25,38 +26,20 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "e1d5f2e6", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "zsh:1: 2.0 not found\n", - "Note: you may need to restart the kernel to use updated packages.\n" - ] - } - ], + "outputs": [], "source": [ "%pip install -U chronos-forecasting>=2.0" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "fcc7e496", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/shchuro/envs/fev/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", - " from .autonotebook import tqdm as notebook_tqdm\n" - ] - } - ], + "outputs": [], "source": [ "# Use only 1 GPU if available\n", "import os\n", From d11af4fb4c22dd11cef5d1e355a31566d411db30 Mon Sep 17 00:00:00 2001 From: Abdul Fatir Date: Mon, 20 Oct 2025 12:54:14 +0000 Subject: [PATCH 18/18] Shorten example --- README.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 2f18f3c2..4568541d 100644 --- a/README.md +++ b/README.md @@ -70,27 +70,22 @@ from chronos import Chronos2Pipeline pipeline = Chronos2Pipeline.from_pretrained("s3://autogluon/chronos-2", device_map="cuda") -target = "target" # Column name containing the values to forecast -prediction_length = 24 # Number of steps to forecast ahead -id_column = "id" # Column identifying different time series -timestamp_column = "timestamp" # Column containing datetime information - -# Load historical energy prices and past values of covariates +# Load historical target values and past values of covariates context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet") -# Load future values of covariates +# (Optional) Load future values of covariates test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet") -future_df = test_df.drop(columns=target) +future_df = test_df.drop(columns="target") # Generate predictions with covariates pred_df = pipeline.predict_df( context_df, future_df=future_df, - prediction_length=prediction_length, - quantile_levels=[0.1, 0.5, 0.9], - id_column=id_column, - timestamp_column=timestamp_column, - target=target, + prediction_length=24, # Number of steps to forecast + quantile_levels=[0.1, 0.5, 0.9], # Quantile for probabilistic forecast + id_column="id", # Column identifying different time series + timestamp_column="timestamp", # Column with datetime information + target="target", # Column(s) with time series values to predict ) ``` @@ -99,9 +94,9 @@ We can now visualize the forecast: ```python import matplotlib.pyplot as plt # requires: pip install matplotlib -ts_context = context_df.set_index(timestamp_column)[target].tail(256) -ts_pred = pred_df.set_index(timestamp_column) -ts_ground_truth = test_df.set_index(timestamp_column)[target] +ts_context = context_df.set_index("timestamp")["target"].tail(256) +ts_pred = pred_df.set_index("timestamp") +ts_ground_truth = test_df.set_index("timestamp")["target"] ts_context.plot(label="historical data", color="xkcd:azure", figsize=(12, 3)) ts_ground_truth.plot(label="future data (ground truth)", color="xkcd:grass green")