Skip to main content

Energy forecast benchmarking toolkit.

Project description

Energy Forecast Benchmark Toolkit

PyPI version Hatch project code style - Black 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enfobench-0.6.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

enfobench-0.6.1-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file enfobench-0.6.1.tar.gz.

File metadata

  • Download URL: enfobench-0.6.1.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for enfobench-0.6.1.tar.gz
Algorithm Hash digest
SHA256 924a1282b648fe08b081ba6dbf13b3a39d6575999ef7e4a032cc2a185bcaa716
MD5 2c1c4c8ce38c1e3b1f77fc5958732f9b
BLAKE2b-256 a76eed8a41d659c2482e1233e24ece509b5dbc81f7ae181ec96d161b02074820

See more details on using hashes here.

File details

Details for the file enfobench-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: enfobench-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for enfobench-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58c317f5123a8e19256e03c4b689d2504d30c7948e8f1936bf8eec1971873ba0
MD5 6412caf25f948d71413ba1a6750f8385
BLAKE2b-256 6c07a91d5c7ec3b0f0734e136240d2d3498cc02df162f6c3f1c8cb1ef8eff7e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page