Skip to content

rebase-energy/treewe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌳 Tree-based predictions for weather and energy

License: MIT PyPI version Join us on Slack GitHub Repo stars

treewe is an open-source Python library that implements state-of-the-art energy and weather prediction models for use cases including as wind, solar and demand forecasting. It is using the enflow structure to evaluate and benchmark prediction models in a reproducible manner. treewe lets you:

  • πŸ”„ Get a unified syntax for working with state-of-the-art tree-based predictor libraries such as XGBoost, LightGBM, CatBoost and Scikit-Learn;
  • πŸ“Š Run and evaluate pre-implemented prediction models on your own energy and weather datasets; and
  • πŸ“ˆ Create your own prediction model and benchmark it against pre-implemented prediction models;

⬇️ Installation  |  πŸ“– Documentation  |  πŸš€ Try out now in Colab  |  πŸ‘‹ Join Community Slack

Basic Usage

treewe uses enflow structure for creating the basic evaluation loop that avoids data leakage and ensures reproducibility. An experiment is represented by the following 4 components:

Given a defined dataset, env (environment), agent (model) and obj (objective), the sequential decision loop is given by:

# Create the env, agent and obj. Your code goes in defining these classes. 
env = GEFCom2014WindEnv()
obj = PinballLoss(quantiles=np.arange(0.1, 1, 0.1))
predictor = LGBGEFCom2014Predictor()

state = env.reset()
next_input, initial_df = env.reset()
predictor1.train(features=initial_df["features"], target=initial_df["target"])

done = False
while done is not True:
    prediction = predictor.predict(features=next_input)
    next_input, next_target, done = env.step()
    loss = obj.calculate(next_target, prediction)

env.close()

For a full walkthrough go to the documentation or open in Colab.

Installation

Install the stable release:

pip install treewe

Install the latest release:

pip install git+https://github.com/rebase-energy/treewe

Install in editable mode for development:

git clone https://github.com/rebase-energy/treewe.git
cd treewe
pip install -e . 

Ways to Contribute

We welcome contributions from anyone interested in this project! Here are some ways to contribute to enerflow:

  • Create a new predictor;
  • Create a new benchmark dataset;
  • Create a new objective function; or
  • Add core functionality to treewe;

If you are interested in contributing, then feel free to join our Community Slack so that we can discuss it.

Licence

This project uses the MIT Licence.

About

🌳 Tree-based predictions for weather and energy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published