- Hasham Akram
- This repository offers a glimpse about training a machine learning model for effective prediction of energy efficiency factors.
- The model predicts heating and cooling loads for residential buildings, enabling optimization, scenario analysis, sensitivity assessment, comparative studies, integration with management systems, and policy support for energy efficiency
Here are screenshots demonstrating the interface of the Structures Energy Efficiency project:
Utilizing a statistical machine learning framework, this project aims to analyze the impact of eight input variables (e.g., relative compactness, surface area) on heating load (HL) and cooling load (CL) in residential buildings. Employing classical and non-parametric statistical tools, we'll identify the strongest correlations between input variables and output variables. The project will compare traditional linear regression with advanced non-linear, non-parametric methods like random forests to estimate HL and CL accurately.
The Dataset you can get through this link: Energy Efficiency Dataset
To import it directly in your code:
pip install ucimlrepo
from ucimlrepo import fetch_ucirepo
# fetch dataset
energy_efficiency = fetch_ucirepo(id=242)
# data (as pandas dataframes)
X = energy_efficiency.data.features
y = energy_efficiency.data.targets
# metadata
print(energy_efficiency.metadata)
# variable information
print(energy_efficiency.variables)
- Database: The given dataset in this project is stored in Cassandra database see the documentation for Create and Connect data in your Local coding environment.
- python 3.8+
- Cassandra Driver (To interact with the Cassandra database, you'll need a suitable driver. The DataStax Python Driver for Apache Cassandra is commonly used for Python projects.)
- pandas
- numpy
- Scikit-learn
- Matplotlib / Seaborn
- Jupyter Notebook
- Flask / Django
- HTML / CSS / JavaScrip
- Docker
Structures Energy Efficiency project
|
|
├───Artifacts
│ .gitignore
│ model.pkl
│ preprocesser.pkl
│ raw.csv
│ test.csv
│ train.csv
│
├───Notebook
│ │ __init__.py
│ │
│ └───Data
│ 1 . EDA ENERGY EFFICIENCY.ipynb
│ 2. MODEL TRAINING_non_EDA.ipynb
│ 3. MODEL TRAINING_EDA.ipynb
│ ANN_model.ipynb
│ cassendra-integration.ipynb
| secure-connect-hasham-akram-db.zip
| Hasham_Akram_db-token.json
│ ENB2012_data.csv
│
│
├───src
│ │ __init__.py
│ │
│ └───MLproject
│ │ __init__.py
│ │ exception.py
│ │ logger.py
│ │ utils.py
│ │
│ ├───components
│ │ __init__.py
│ │ data_ingestion.py
│ │ data_transformation.py
│ │ model_monitoring.py
│ │ model_trainer.py
│ │
│ └───pipelines
│ __init__.py
│ prediction_pipeline.py
│ trainig_pipeline.py
|
|____templates
| |
| |________index.html
| |
| |________home.html
|
|
|
│
│ Dockerfile
│ main.py
│ README.md
│ requirements.txt
│ setup.py
│ template.py
│ webapp.py
This project is deployed on an AWS EC2 instance using a Docker image stored in Amazon ECR. Continuous Integration and Continuous Deployment (CI/CD) pipelines are implemented using GitHub Actions for automated deployment.
This projects CI/CD pipeline
- An AWS account with permissions to create and manage EC2 instances and ECR repositories.
- Docker installed locally.
- AWS CLI configured with appropriate credentials.
- GitHub repository set up with appropriate access and permissions.
Provide step-by-step instructions on how to deploy the project. Include commands, configurations, or any other relevant information necessary for deployment.
Continuous Integration (CI) Setup
-
Step 1: Create a GitHub Actions workflow file in your project repository (e.g., .github/workflows/main.ymal) to define CI jobs.
name: Continuous Integration on: push: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Build Docker image run: | docker build -t your-image-name .
-
Step 2: Configure AWS credentials and permissions in GitHub Secrets to allow GitHub Actions to push Docker images to Amazon ECR.
Continuous Deployment (CD) Setup
- Step 1: Add a deployment workflow file (e.g., .github/workflows/main.ymal) to your project repository to define CD jobs.
Example main.ymal:
name: Continuous Deployment
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Amazon ECR
run: aws ecr get-login-password --region your-region | docker login --username AWS --password-stdin your-account-id.dkr.ecr.your-region.amazonaws.com
- name: Push Docker image to ECR
run: |
docker tag your-image-name:latest your-account-id.dkr.ecr.your-region.amazonaws.com/your-repository-name:latest
docker push your-account-id.dkr.ecr.your-region.amazonaws.com/your-repository-name:latest
- Step 2: Set up an EC2 instance on AWS and install Docker to run your Dockerized application.
optional
sudo apt-get update -y
sudo apt-get upgrade
required
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker ubuntu
newgrp docker
-
AWS_ACCESS_KEY_ID=
-
AWS_SECRET_ACCESS_KEY=
-
AWS_REGION =
-
AWS_ECR_LOGIN_URI =
-
ECR_REPOSITORY_NAME =
- Make sure to replace placeholders such as your-image-name, your-account-id, your-region, and your-repository-name with actual values.
- Monitor your CI/CD pipelines in GitHub Actions to ensure successful builds and deployments.
- Configure proper security settings and access controls for your AWS resources and GitHub repository.