fev: Forecast evaluation library
Project description
fev
A lightweight library that makes it easy to benchmark time series forecasting models.
- Extensible: Easy to define your own forecasting tasks and benchmarks.
- Reproducible: Ensures that the results obtained by different users are comparable.
- Easy to use: Compatible with most popular forecasting libraries.
- Minimal dependencies: Just a thin wrapper on top of 🤗
datasets.
How is fev different from other benchmarking tools?
Existing forecasting benchmarks usually fall into one of two categories:
- Standalone datasets without any supporting infrastructure. These provide no guarantees that the results obtained by different users are comparable. For example, changing the start date or duration of the forecast horizon totally changes the meaning of the scores.
- Bespoke end-to-end systems that combine models, datasets and forecasting tasks. Such packages usually come with lots of dependencies and assumptions, which makes extending or integrating these libraries into existing systems difficult.
fev aims for the middle ground - it provides the core benchmarking functionality without introducing unnecessary constraints or bloated dependencies. The library supports point & probabilistic forecasting, different types of covariates, as well as all popular forecasting metrics.
Installation
pip install fev
Quickstart
Create a task from a dataset stored on Hugging Face Hub
import fev
task = fev.Task(
dataset_path="autogluon/chronos_datasets",
dataset_config="monash_kdd_cup_2018",
horizon=12,
)
Load data available as input to the forecasting model
past_data, future_data = task.get_input_data()
past_datacontains the past data before the forecast horizon (item ID, past timestamps, target, all covariates).future_datacontains future data that is known at prediction time (item ID, future timestamps, and known covariates)
Make predictions
def naive_forecast(y: list, horizon: int) -> list:
return [y[-1] for _ in range(horizon)]
predictions = []
for ts in past_data:
predictions.append(
{"predictions": naive_forecast(y=ts[task.target_column], horizon=task.horizon)}
)
Get an evaluation summary
task.evaluation_summary(predictions, model_name="naive")
# {'model_name': 'naive',
# 'dataset_name': 'chronos_datasets_monash_kdd_cup_2018',
# 'dataset_path': 'autogluon/chronos_datasets',
# 'dataset_config': 'monash_kdd_cup_2018',
# 'horizon': 12,
# 'cutoff': -12,
# 'lead_time': 1,
# 'min_context_length': 1,
# 'max_context_length': None,
# 'seasonality': 1,
# 'eval_metric': 'MASE',
# 'extra_metrics': [],
# 'quantile_levels': None,
# 'id_column': 'id',
# 'timestamp_column': 'timestamp',
# 'target_column': 'target',
# 'generate_univariate_targets_from': None,
# 'past_dynamic_columns': [],
# 'excluded_columns': [],
# 'test_error': 3.3784518866750513,
# 'training_time_s': None,
# 'inference_time_s': None,
# 'dataset_fingerprint': 'a22d13d4c1e8641c',
# 'trained_on_this_dataset': False,
# 'fev_version': '0.5.0',
# 'MASE': 3.3784518866750513}
The evaluation summary contains all information necessary to uniquely identify the forecasting task.
Multiple evaluation summaries produced by different models on different tasks can be aggregated into a single table.
# Dataframes, dicts, JSON or CSV files supported
summaries = "https://raw.githubusercontent.com/autogluon/fev/refs/heads/main/benchmarks/example/results/results.csv"
fev.leaderboard(summaries)
# | model_name | gmean_relative_error | avg_rank | avg_inference_time_s | ... |
# |:---------------|-----------------------:|-----------:|-----------------------:|------:|
# | auto_theta | 0.874 | 2 | 5.501 | ... |
# | auto_arima | 0.887 | 2 | 21.799 | ... |
# | auto_ets | 0.951 | 2.667 | 0.737 | ... |
# | seasonal_naive | 1 | 3.333 | 0.004 | ... |
Tutorials
- Quickstart: Define a task and evaluate a model.
- Datasets: Use
fevwith your own datasets. - Tasks & benchmarks: Advanced features for defining tasks and benchmarks.
- Models: Evaluate your models and submit results to the leaderboard.
Examples of model implementations compatible with fev are available in examples/.
Leaderboards
We host leaderboards obtained using fev under https://huggingface.co/spaces/autogluon/fev-leaderboard.
Currently, the leaderboard includes the results from the Benchmark II introduced in Chronos: Learning the Language of Time Series. We expect to extend this list in the future.
Datasets
Repositories with datasets in format compatible with fev:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fev-0.6.0rc2.tar.gz.
File metadata
- Download URL: fev-0.6.0rc2.tar.gz
- Upload date:
- Size: 56.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f02a807b2e922cb7636576f0939021d6cd227b46938886a7a337b64f98a698aa
|
|
| MD5 |
8d2242a60c533ced8c4304cafc71edbe
|
|
| BLAKE2b-256 |
22119eb195a24781201012c23e60b2ac3ee946297da0b6052716ab8bb4b3117a
|
Provenance
The following attestation bundles were made for fev-0.6.0rc2.tar.gz:
Publisher:
publish-to-pypi.yml on autogluon/fev
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fev-0.6.0rc2.tar.gz -
Subject digest:
f02a807b2e922cb7636576f0939021d6cd227b46938886a7a337b64f98a698aa - Sigstore transparency entry: 383752150
- Sigstore integration time:
-
Permalink:
autogluon/fev@35bd3b4df65c0c2ab57c430aa313ab58654796b2 -
Branch / Tag:
refs/tags/v0.6.0rc2 - Owner: https://github.com/autogluon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@35bd3b4df65c0c2ab57c430aa313ab58654796b2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fev-0.6.0rc2-py3-none-any.whl.
File metadata
- Download URL: fev-0.6.0rc2-py3-none-any.whl
- Upload date:
- Size: 35.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
740d2eba09045fbb5af023230be10ecc243a005a1fa844631061c6da0807821d
|
|
| MD5 |
8f279caae5684e5c23de1ef4d7bdaa8e
|
|
| BLAKE2b-256 |
b82a6a57e38b0a197d68d0f195ff8abdecaa01454969328b60444a29cc4af84d
|
Provenance
The following attestation bundles were made for fev-0.6.0rc2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on autogluon/fev
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fev-0.6.0rc2-py3-none-any.whl -
Subject digest:
740d2eba09045fbb5af023230be10ecc243a005a1fa844631061c6da0807821d - Sigstore transparency entry: 383752169
- Sigstore integration time:
-
Permalink:
autogluon/fev@35bd3b4df65c0c2ab57c430aa313ab58654796b2 -
Branch / Tag:
refs/tags/v0.6.0rc2 - Owner: https://github.com/autogluon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@35bd3b4df65c0c2ab57c430aa313ab58654796b2 -
Trigger Event:
release
-
Statement type: