This project aims to predict the energy consumption of buildings in terms of heating load and cooling load. The objective is to utilize machine learning models to estimate energy efficiency based on various building parameters.
- Source: UCI Machine Learning Repository - Energy Efficiency
- Instances: 768
- Features: 8
- Target Variables: Heating Load (Y1), Cooling Load (Y2)
energy-consumption-prediction/
├── .github/
│ └── workflows/
│ └── ci_cd_pipeline.yml
├── data/
│ ├── raw/
│ │ └── ENB2012_data.xlsx
│ ├── processed/
│ └── ENB2012_data_processed.csv
├── kubernetes/
│ ├── deployment.yaml
│ └── service.yaml
├── notebooks/
│ ├── 1_data_preparation.ipynb
│ ├── 2_model_training.ipynb
│ └── 3_model_evaluation.ipynb
├── src/
│ ├── data_preparation.py
│ ├── model_training.py
│ └── model_evaluation.py
├── Dockerfile
├── README.md
└── requirements.txt
- Python 3.8 or later
- Docker
- Kubernetes (kubectl)
- GitHub account (for CI/CD)
-
Clone the repository:
git clone https://github.com/oaslananka/energy-consumption-prediction.git cd energy-consumption-prediction
-
Install Python dependencies:
pip install -r requirements.txt
-
Prepare the data:
- Download the dataset and place it in the
data/raw/
directory. - Run the
1_data_preparation.ipynb
notebook to preprocess the data.
- Download the dataset and place it in the
-
Train the model:
- Run the
2_model_training.ipynb
notebook to train the models.
- Run the
-
Evaluate the model:
- Run the
3_model_evaluation.ipynb
notebook to evaluate and visualize the model performance.
- Run the
-
Build the Docker image:
docker build -t energy-consumption-prediction .
-
Run the Docker container:
docker run --rm energy-consumption-prediction
-
Apply the deployment and service:
kubectl apply -f kubernetes/deployment.yaml kubectl apply -f kubernetes/service.yaml
-
Check the status:
kubectl get deployments kubectl get services
This project uses GitHub Actions for continuous integration and continuous deployment. The pipeline is defined in .github/workflows/ci_cd_pipeline.yml
.
-
Set up GitHub Secrets:
DOCKER_USERNAME
: Your Docker Hub usernameDOCKER_PASSWORD
: Your Docker Hub password
-
Push the changes to GitHub:
git add . git commit -m "Set up CI/CD pipeline" git push origin main
- The model performance metrics and visualizations are available in the
3_model_evaluation.ipynb
notebook. - Heating Load MSE: value
- Cooling Load MSE: value
This project is licensed under the MIT License. See the LICENSE file for details.
- UCI Machine Learning Repository for the dataset.
- Contributors to the open-source libraries used in this project.
This project is a practice exercise and is not intended for production use. It serves as a learning tool for implementing machine learning models, Docker, and Kubernetes.