{"id":23658459,"url":"https://github.com/seekai-786/electricity_theft_detection","last_synced_at":"2026-04-20T19:32:23.306Z","repository":{"id":269718329,"uuid":"908244887","full_name":"SeekAI-786/Electricity_Theft_Detection","owner":"SeekAI-786","description":"Electricity theft is a major issue in regions like Karachi, where unauthorized consumption of electricity leads to significant losses for utility companies. This project provides a solution for detecting electricity theft using machine learning models. By analyzing various factors such as electricity usage, voltage fluctuations, and historical data","archived":false,"fork":false,"pushed_at":"2025-07-29T07:28:49.000Z","size":3527,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T22:11:22.888Z","etag":null,"topics":["datacleaning","datapreprocessing","electricity-theft","jupyter-notebook","machine-learning","ml","ml-pipelines","pipeline","realworld-application"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SeekAI-786.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-25T15:02:45.000Z","updated_at":"2025-07-29T07:28:53.000Z","dependencies_parsed_at":"2024-12-25T16:18:45.762Z","dependency_job_id":"aa89ac37-ace0-4e5a-b8a1-aeb9a31da733","html_url":"https://github.com/SeekAI-786/Electricity_Theft_Detection","commit_stats":null,"previous_names":["seekai-786/electricity_theft_detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SeekAI-786/Electricity_Theft_Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeekAI-786%2FElectricity_Theft_Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeekAI-786%2FElectricity_Theft_Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeekAI-786%2FElectricity_Theft_Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeekAI-786%2FElectricity_Theft_Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeekAI-786","download_url":"https://codeload.github.com/SeekAI-786/Electricity_Theft_Detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeekAI-786%2FElectricity_Theft_Detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["datacleaning","datapreprocessing","electricity-theft","jupyter-notebook","machine-learning","ml","ml-pipelines","pipeline","realworld-application"],"created_at":"2024-12-29T00:13:06.621Z","updated_at":"2026-04-20T19:32:23.280Z","avatar_url":"https://github.com/SeekAI-786.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Electricity Theft Detection System\n\n## Purpose\n\nElectricity theft is a major issue in regions like Karachi, where unauthorized consumption of electricity leads to significant losses for utility companies. This project provides a solution for detecting electricity theft using machine learning models. By analyzing various factors such as electricity usage, voltage fluctuations, and historical data, the system predicts the likelihood of theft.\n\n## Model Overview\n\nThe machine learning model used in this project is a **Random Forest Classifier**. This model was chosen due to its ability to handle complex data with multiple features and its robustness in classification tasks.\n\n### Key Techniques Used:\n1. **SMOTE (Synthetic Minority Over-sampling Technique)**: Used to handle class imbalance in the dataset. It generates synthetic samples for the underrepresented class (theft) to improve model performance.\n   \n2. **Grid Search for Hyperparameter Tuning**: The model was fine-tuned using `GridSearchCV`, which optimizes the hyperparameters of the Random Forest classifier to find the best-performing configuration. Key hyperparameters tuned include:\n   - `n_estimators`: The number of trees in the forest (100, 200, 300).\n   - `max_depth`: The maximum depth of the trees (None, 10, 20).\n   - `min_samples_split`: The minimum number of samples required to split an internal node (2, 5, 10).\n\n### Model Pipeline:\nThe model is part of a pipeline that includes:\n- **Standard Scaling**: Scales input features to standardize the dataset.\n- **Random Forest Classifier**: A robust classification model to predict the likelihood of electricity theft.\n\n## How to Run the Streamlit App\n\n1. **Install Dependencies**:\n   Before running the Streamlit app, make sure to install all necessary dependencies. You can do this by running the following command:\n   ```bash\n   pip install -r requirements.txt\n\n2. **Run the Streamlit App**:\nOnce the dependencies are installed, you can run the Streamlit app using the following command:\n```bash\nstreamlit run app.py\n```\n\nThis will launch the app in your web browser, typically at http://localhost:8501.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseekai-786%2Felectricity_theft_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseekai-786%2Felectricity_theft_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseekai-786%2Felectricity_theft_detection/lists"}