The goal of MLAI Green Battery Hack is to develop a strategy to optimise battery operations within an energy market simulation. Our challenge is to create algorithms, or policies, that expertly manage batery charging and discharging in response to real-time market data and incoming energy from a simulated solar panel.
We are proud to have achieved a final ranking of 4th place in the competition amongst the many teams formed in Melbourne and Sydney. Our team, Skvalp, have incorporated a similar approach as the 1st place winners team, which will be discussed in the following section. Despite passing the tests and getting our code to work for the provisional leaderboard, we ran into some technical issues due to utilising a function that was not documented properly for participants' usage. We had to disable a function in order for our algorithm to work properly in the final leaderboard simulation, which resulted in a lower score than expected. However, we are proud of our team's efforts and the final result as the process was very rewarding for me.
Screenshot of the provisional leaderboard rankings before the cut-off deadline for code submissions, taken at 4:59PM on 21st April 2024. We were so excited that we're provisionally 1st!
Screenshot of the final leaderboard rankings after the competition ended, check it on this link.
Disclaimer: As some of our team members are working on a start-up company, due to proprietary reasons, I have removed the code used in optimising the actions of our batteries used in our strategy.
Two powerful Python libraries for time series forecasting were implemented: sktime and darts.
sktime is a unified framework for machine learning with time series. It provides a collection of algorithm implementations for timeseries classification, regression, clustering, and forecasting. Key features include:
- A scikit-learn compatible API
- Support for various time series learning tasks
- Composable machine learning pipelines
- Extensible framework for custom algorithm development
darts (Dataframe-based Automated Regression for Time Series) is a Python library for easy manipulation and forecasting of time series. It offers:
- A wide range of forecasting models, including statistical, machine learning, and deep learning approaches
- Tools for preprocessing, transforming, and feature engineering time series data
- Built-in support for backtesting and model evaluation
- Scalability for large datasets
After hacking with these libraries for a few days, Darts was chosen as the main library for our framework. Darts in our scenario offers several advantages:
- Efficient handling of multi-step forecasting
- Support for past covariates without requiring full model retraining
- Faster processing times, which is crucial given our 5-minute constraint
The system uses an ensemble of regression models for price prediction:
- XGBoost models
- CatBoost model
These models are trained on historical price data, demand, and temperature information. The system switches between 12-hour and 24-hour models initially based on the amount of available historical data.
The SreshtaGyan
class in simple.py
implements the main optimization logic:
- Generates price forecasts using ML models and basic forecasting techniques
- Incorporates solar power forecasts from external sources
- Calculates optimal battery charge/discharge strategies using the
find_optimal_discharge
function - Considers dynamic State of Energy (SOE) limits for better battery management
For more information about the guidelines provided by the hackathon, please check out hackathon.md.
Thanks to all the team members of Skvalp who have contributed to this project:
- Jithin George, @j-georgeAU
- Vishnu Vinayamohanan, @vihnuav08
- Bigi Philip, @bigiphilip
- Eric Kim, @EricKim9724
- Victor Goh, @victorwkb
Special thanks to MLAI Aus for always organising such amazing hackathons and the sponsors that made this happen!