fev: Forecast evaluation library
Project description
fev
Utilities for evaluating time series forecasting models.
fev adds a thin wrapper on top of the Hugging Face (HF) datasets library, resulting in a lightweight but fully functional benchmarking solution.
Specifically, this package makes it easy to
- define forecasting tasks
- load time series data and generate train-test splits
- evaluate model predictions
fev supports point & probabilistic forecasting, different types of covariates, as well as all popular forecasting metrics.
Installation
Clone the repository and install with pip
pip install -e .
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_fingerprint': '8a50d3417859652b',
# 'dataset_path': 'autogluon/chronos_datasets',
# 'dataset_config': 'monash_kdd_cup_2018',
# 'horizon': 12,
# 'cutoff': -12,
# 'lead_time': 1,
# 'min_ts_length': 13,
# 'max_context_length': None,
# 'seasonality': 1,
# 'eval_metric': 'MASE',
# 'extra_metrics': [],
# 'quantile_levels': None,
# 'id_column': 'id',
# 'timestamp_column': 'timestamp',
# 'target_column': 'target',
# 'multiple_target_columns': None,
# 'past_dynamic_columns': [],
# 'excluded_columns': [],
# 'test_error': 3.3784518,
# 'training_time_s': None,
# 'inference_time_s': None,
# 'fev_version': '0.1.0',
# 'MASE': 3.3784518}
The evaluation summary contains all information necessary to uniquely identify the forecasting task.
Tutorials
- Quick start tutorial: docs/tutorials/quickstart.ipynb.
- An in-depth walkthrough of the library: docs/tutorials/in-depth.ipynb.
Examples of model implementations compatible with fev are available in examples/.
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.0.1a2.tar.gz.
File metadata
- Download URL: fev-0.0.1a2.tar.gz
- Upload date:
- Size: 36.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d891fa9c543eb0b38596f95d140132d693fa12fbf698d7b0cb2e4b62193b77a0
|
|
| MD5 |
ae362fe35037af13d2ead2cfbbb710cf
|
|
| BLAKE2b-256 |
f96499390033970a532e8e3877c98e6f2137c35fd39a00c75e5d280f2fa0465d
|
Provenance
The following attestation bundles were made for fev-0.0.1a2.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.0.1a2.tar.gz -
Subject digest:
d891fa9c543eb0b38596f95d140132d693fa12fbf698d7b0cb2e4b62193b77a0 - Sigstore transparency entry: 154177486
- Sigstore integration time:
-
Permalink:
autogluon/fev@07a74d980f7985b18f6eb03b2cfc1e913beed4e0 -
Branch / Tag:
refs/tags/v0.0.1a2 - Owner: https://github.com/autogluon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@07a74d980f7985b18f6eb03b2cfc1e913beed4e0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fev-0.0.1a2-py3-none-any.whl.
File metadata
- Download URL: fev-0.0.1a2-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0116fd4047f44262127e491bc9dd19144c56b05e59849833e6c0a5129e5d1e0
|
|
| MD5 |
703613a70493c9dde5bc5536d7ddedf7
|
|
| BLAKE2b-256 |
306974becd1f55a297f6938888d7e34d7002371a20e8e4a092ad6a7724c71d49
|
Provenance
The following attestation bundles were made for fev-0.0.1a2-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.0.1a2-py3-none-any.whl -
Subject digest:
c0116fd4047f44262127e491bc9dd19144c56b05e59849833e6c0a5129e5d1e0 - Sigstore transparency entry: 154177489
- Sigstore integration time:
-
Permalink:
autogluon/fev@07a74d980f7985b18f6eb03b2cfc1e913beed4e0 -
Branch / Tag:
refs/tags/v0.0.1a2 - Owner: https://github.com/autogluon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@07a74d980f7985b18f6eb03b2cfc1e913beed4e0 -
Trigger Event:
release
-
Statement type: