Welcome to the Building Energy Management repository here you will find the tools to create an app to predict the energy consumption of your household.
The project was built on spyder v4.1.5. A detailed description of the environment setup while making the project has been saved in the requirements.txt file that can be accessed using the following command on the desired virtualenv:
pip install -r requirements.txt
Note:- Remember to set up and activate the virtual env before running the code.
The data regarding energy consumption was acquired from the UCI machine learning repository which can be accessed through this link.
Note:- Fully engineered and raw datasets are already attached to the repository for convenience.
Weather dataset for Sceaux Paris for the desired years was obtained from the NSRDB data viewer although now the historical data is currently unavailable thus the data has been attached to the repository as well. The viewer is still a very useful asset to download historical weather data as well as solar irradiation data and thus the link has been shared:
The two datasets were merged according to their dates carefully to identify whether the weather data had an effect on power consumption and indeed it did. Thus solidifying our stance on the inclusion of the dataset. This furthers our methodology of including weather data for the evaluation of power consumption in a particular household.
- Handling Missing Data / NaN's
- Sorting the data
- Resampling the data Hourly
- Concatenating the weather and Energy dataset
- Feature Engineering
- Converting the scalers into pkl files
- Training dataset
- Test dataset
- Creation of a look back function
- Creating Tensor with desired layers
Long Short Term Memory (LSTM) architecture using the sliding window algorithm was used to train the prepared dataset and the weights were exported on an h5 file to use with the test dataset. Since the Deep learning frameworks take a lot of time to run (the LSTM model ran for 1hr 46 min for 100 iterations) to evaluate on a test dataset it is best to import the datasets the weights and pkl from our pre-trained model.
Streamlit is an app framework designed for ML engineers and data scientists. It works on python and is compatible with many other data science libraries for an easier workflow. Streamlit can be installed in the system using the following command:
pip install streamlit
Streamlit provides widgets to display dataframes, calendar, graphs thus eschewing the use python web designing frame such as flask to create backend for these elements and the ML engineer can thus focus his efforts in creating the linkage of the machine learning model with the interface.
To run the app on your system,download the repository setup the environment and requirements and use the following code:
streamlit run app.py
in your terminal.
The app should look like :
And yes the app is in Dark Mode !!!!