{"id":25376501,"url":"https://github.com/akhundmuzzammil/energyconsumptionprediction","last_synced_at":"2026-04-18T04:33:08.822Z","repository":{"id":277412118,"uuid":"932333503","full_name":"akhundmuzzammil/EnergyConsumptionPrediction","owner":"akhundmuzzammil","description":"This repository contains code and resources for training a linear regression model to predict energy consumption based on various building parameters.","archived":false,"fork":false,"pushed_at":"2025-03-12T16:52:17.000Z","size":2319,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T17:39:01.888Z","etag":null,"topics":["data-analysis","energy-consumption","linear-regression","machine-learning","python","scikit-learn","streamlit","visualization"],"latest_commit_sha":null,"homepage":"https://energyconsumptionpredictionlr.streamlit.app","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akhundmuzzammil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-13T18:39:50.000Z","updated_at":"2025-03-12T16:52:21.000Z","dependencies_parsed_at":"2025-02-13T20:35:08.160Z","dependency_job_id":null,"html_url":"https://github.com/akhundmuzzammil/EnergyConsumptionPrediction","commit_stats":null,"previous_names":["akhundmuzzammil/energyconsumptionprediction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhundmuzzammil%2FEnergyConsumptionPrediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhundmuzzammil%2FEnergyConsumptionPrediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhundmuzzammil%2FEnergyConsumptionPrediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhundmuzzammil%2FEnergyConsumptionPrediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akhundmuzzammil","download_url":"https://codeload.github.com/akhundmuzzammil/EnergyConsumptionPrediction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248017997,"owners_count":21034042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","energy-consumption","linear-regression","machine-learning","python","scikit-learn","streamlit","visualization"],"created_at":"2025-02-15T04:28:05.645Z","updated_at":"2026-04-18T04:33:08.785Z","avatar_url":"https://github.com/akhundmuzzammil.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Energy Consumption Prediction\n\nWelcome to the Energy Consumption Prediction project! This repository contains code and resources for training a linear regression model to predict energy consumption based on various building parameters. The project includes data preprocessing, exploratory data analysis (EDA), model training and evaluation, and a web interface for making predictions.\n\n## Overview\n\nThe goal of this project is to predict the energy consumption of buildings based on features such as:\n- Building Type\n- Square Footage\n- Number of Occupants\n- Appliances Used\n- Average Temperature\n- Day of Week\n\nThe project employs a linear regression model, and the workflow includes:\n- Data ingestion and preprocessing\n- Handling missing data\n- Data normalization using a `StandardScaler`\n- One-hot encoding of categorical features\n- Model training, evaluation, and persistence using `pickle` and `joblib`\n- Visualization and exploratory data analysis (EDA) using seaborn and matplotlib\n\n## Project Structure\n\n- **app.py**: The main application file (likely a web app using Streamlit) for real-time predictions. Check out the footer instructions in [app.py](app.py).\n- **EnergyConsumptionPrediction.ipynb**: A Jupyter Notebook for interactive exploration.\n- **training.ipynb**: A Jupyter Notebook containing the full workflow for data preprocessing, model training, evaluation, and saving the model.\n- **linear_regression_model.pkl**: Pickled trained linear regression model.\n- **scaler.pkl**: Pickled scaler used to standardize the numerical features.\n- **train_energy_data.csv** \u0026 **test_energy_data.csv**: Datasets for training and testing.\n- **images/**: Directory containing images. See below for screenshots.\n\n- **requirements.txt**: A list of Python dependencies.\n- **LICENSE**: Project license.\n- **README.md**: This file.\n\n## Installation\n\n1. **Clone the repository:**\n\n   ```sh\n   git clone https://github.com/yourusername/EnergyConsumptionPrediction.git\n   cd EnergyConsumptionPrediction\n   ```\n\n2. **Create a virtual environment (optional but recommended):**\n\n   ```sh\n   python -m venv venv\n   source venv/bin/activate  # On Windows use: venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies:**\n\n   ```sh\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n### Training the Model\n\nTo train the model from scratch:\n\n1. Open the training.ipynb notebook in Jupyter Notebook or Google Colab.\n2. Run the cells sequentially to:\n   - Load and preprocess the data.\n   - Train the linear regression model.\n   - Evaluate model performance.\n   - Save the trained model using `joblib` and the scaler using `pickle`.\n\n   The notebook includes cells for data exploration, normalization, one-hot encoding, and visualization of training results.\n\n### Running the Web App\n\nA web interface is provided for real-time predictions:\n\n1. Ensure that the trained model and scaler are available in the project directory (`linear_regression_model.pkl` and scaler.pkl).\n2. Run the app using Streamlit:\n\n   ```sh\n   streamlit run app.py\n   ```\n\n3. Follow the on-screen instructions to enter building details and predict energy consumption.\n\n## Data\n\n- **Training Data:** train_energy_data.csv\n- **Test Data:** test_energy_data.csv\n\n## Dataset Reference\n\nThis dataset is designed for predicting energy consumption based on various building features and environmental factors. It contains data for multiple building types, square footage, the number of occupants, appliances used, average temperature, and the day of the week. The goal is to build a predictive model to estimate energy consumption using these attributes. \n\nThe dataset can be used for training machine learning models such as linear regression to forecast energy needs based on the building's characteristics. This is useful for understanding energy demand patterns and optimizing energy consumption in different building types and environmental conditions.\n\nLink: [Kaggle Energy Consumption Dataset](https://www.kaggle.com/datasets/govindaramsriram/energy-consumption-dataset-linear-regression?select=train_energy_data.csv)\n\n## Results\n\nModel evaluation metrics and visualizations such as scatter plots, pairplots, and correlation heatmaps are generated in the notebooks. The model summary includes coefficients and intercept, with performance measured using metrics like Mean Squared Error (MSE) and R² score.\n\n## Screenshots\n\nHere are some screenshots from the project:\n\n### Web Application UI\n\n![UI](images/UI.png)\n\n### Training Visuals\n\n![Visualization 1](images/download.png)\n![Visualization 2](images/download%20(1).png)\n![Visualization 3](images/download%20(2).png)\n![Visualization 4](images/download%20(3).png)\n![Visualization 5](images/download%20(4).png)\n\n## Dependencies\n\nThe project is built with the following main libraries:\n\n- Python 3.x\n- pandas\n- numpy\n- scikit-learn\n- matplotlib\n- seaborn\n- joblib\n- pickle\n- streamlit\n\nAll dependencies are listed in requirements.txt.\n\n## License\n\nThis project is licensed under the terms specified in the [LICENSE](LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhundmuzzammil%2Fenergyconsumptionprediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakhundmuzzammil%2Fenergyconsumptionprediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhundmuzzammil%2Fenergyconsumptionprediction/lists"}