Skip to main content

Energy Forecast Benchmark Toolkit

PyPI version Hatch project linting - Ruff types - Mypy

Energy Forecast Benchmark Toolkit is a Python project that aims to provide common tools to benchmark forecast models.


Documentation: https://attila-balint-kul.github.io/energy-forecast-benchmark-toolkit/

Datasets

Dashboards

Table of Contents


Installation

Use the package manager pip to install foobar.

pip install enfobench

Usage

Download the HuggingFace Dataset 'EDS-lab/electricity-demand', and download the files from the data folder to your computer.

import pandas as pd

from enfobench import Dataset
from enfobench.datasets import ElectricityDemandDataset
from enfobench.evaluation import cross_validate, evaluate_metrics
from enfobench.evaluation.metrics import mean_bias_error, mean_absolute_error, root_mean_squared_error

# Load the dataset from the folder that you downloaded the files to.
ds = ElectricityDemandDataset("/path/to/the/dataset/folder/that/contains/all/subsets")

# List all meter ids
ds.list_unique_ids()

# Get one of the meter ids
unique_id = ds.list_unique_ids()[0]

# Get dataset for a specific meter id
target, past_covariates, metadata = ds.get_data_by_unique_id(unique_id)

# Create a dataset
dataset = Dataset(
    target=target,
    past_covariates=past_covariates,
    future_covariates=None,
    metadata=metadata
)

# Import your model and instantiate it
model = MyForecastModel()

# Run cross validation on your model
cv_results = cross_validate(
    model,
    dataset,
    start_date=pd.Timestamp("2018-01-01"),
    end_date=pd.Timestamp("2018-01-31"),
    horizon=pd.Timedelta("24 hours"),
    step=pd.Timedelta("1 day"),
)

# Simply pass in the cross validation results and the metrics you want to evaluate.
metrics = evaluate_metrics(
    cv_results,
    metrics={
        "MBE": mean_bias_error,
        "MAE": mean_absolute_error,
        "RMSE": root_mean_squared_error,
    },
)

To get started with some examples check out the models folder and the examples section of the documentation.

Benchmarking

Once confident in your model, you can submit for evaluation. The results of the benchmarks are openly accessible through various dashboards. The links you can find above.

Contributing

Contributions and feedback are welcome! For major changes, please open an issue first to discuss what you would like to change.

If you'd like to contribute to the project, please follow these steps:

Fork the repository. Create a new branch for your feature or bug fix. Make your changes and commit them. Push your changes to your forked repository. Submit a pull request describing your changes.

License

BSD-3-Clause license

Metadata

Release files for enfobench 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enfobench 0.8.0
File Size Uploaded
enfobench-0.8.0.tar.gz 25.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for enfobench 0.8.0
File Interpreter ABI Platform
enfobench-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.4 kB

Release files / enfobench-0.8.0.tar.gz

Download URL enfobench-0.8.0.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6c35478339d77286463a9c92d4feae516780b4bf6a1b8f9e13c9efd9b9dc2ede
BLAKE2b-256 checksum
How to use checksums
efbda1dd3f1416ae25192b5e7bc075272ff608a2e1aa03351fe3bfbb649db73b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / enfobench-0.8.0-py3-none-any.whl

Download URL enfobench-0.8.0-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3aadf895d8f0557b8f0a836c26993801a1382c1db20dd479ef81c08beb919b17
BLAKE2b-256 checksum
How to use checksums
b9e983d6294964d95f5627a727ef66aed1febe62ff1c43416bcd7742a4c233c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page