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
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.
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 .
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.
This project uses the MIT Licence.