{"id":18824352,"url":"https://github.com/rijul007/classification-on-imbalanced-data-using-python","last_synced_at":"2026-01-20T03:30:20.294Z","repository":{"id":257239211,"uuid":"855764705","full_name":"rijul007/Classification-on-Imbalanced-Data-using-Python","owner":"rijul007","description":"Machine Learning Python project aimed at classifying imbalanced data by employing advanced techniques to refine model accuracy and performance.","archived":false,"fork":false,"pushed_at":"2024-09-14T12:30:06.000Z","size":898,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T04:27:24.849Z","etag":null,"topics":["data-science","machine-learning","python"],"latest_commit_sha":null,"homepage":"https://nbviewer.org/gist/rijul007/94fab12ca87d1ddb1ddbe32b6e34704e","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rijul007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-11T12:38:34.000Z","updated_at":"2024-09-15T10:41:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7e28c79-4949-410a-9020-9ce1725c1e1d","html_url":"https://github.com/rijul007/Classification-on-Imbalanced-Data-using-Python","commit_stats":null,"previous_names":["rijul007/classification-on-imbalanced-data-using-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijul007%2FClassification-on-Imbalanced-Data-using-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijul007%2FClassification-on-Imbalanced-Data-using-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijul007%2FClassification-on-Imbalanced-Data-using-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijul007%2FClassification-on-Imbalanced-Data-using-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rijul007","download_url":"https://codeload.github.com/rijul007/Classification-on-Imbalanced-Data-using-Python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239762678,"owners_count":19692709,"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-science","machine-learning","python"],"created_at":"2024-11-08T00:56:14.706Z","updated_at":"2026-01-20T03:30:20.229Z","avatar_url":"https://github.com/rijul007.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Classification on Imbalanced Data using Python\n\n## Objective\nThis project aims to develop a classification model on an imbalanced dataset. The primary goal is to handle the challenges associated with imbalanced class distribution, particularly in predicting the minority class effectively.\n\n## Dataset Used\nThe dataset used for this project is from [Statso](https://statso.io/training-models-on-imbalanced-data-case-study/). It contains insurance policy records, including customer demographics, vehicle details, and the `claim_status` target variable. The data has 58,592 entries and 41 columns, with a significant imbalance between the classes (claims vs. no claims).\n\n## Analysis Technique\nTo address the class imbalance, the following techniques were used extensively throughout the analysis:\n\n1. **Data Preprocessing**:\n   - **Exploratory Data Analysis (EDA)**: The data was explored to understand the distribution of numerical and categorical features.\n   - **Handling Missing Values**: Checked for missing values and confirmed none were present in the dataset.\n   - **Data Visualization**: Plots were generated to examine the class imbalance and feature distributions.\n\n2. **Class Imbalance Handling**:\n   - **Oversampling**: Synthetic Minority Over-sampling Technique (SMOTE) was used to balance the classes. This was crucial because the dataset showed a heavy imbalance, with significantly fewer claims (`claim_status = 1`) than non-claims (`claim_status = 0`).\n   - **Resampling**: By creating synthetic samples of the minority class, we ensured that both classes were equally represented in the training data, preventing the model from becoming biased towards the majority class.\n\n3. **Feature Selection**:\n   - Analyzed the importance of both numerical and categorical variables using feature importance metrics. Key features like `policy_id`, `subscription_length`, and `customer_age` were identified as the most influential in predicting the claim status.\n\n4. **Model Building**:\n   - **Random Forest Classifier**: Chosen for its robustness in handling imbalanced data. The model was trained on the balanced dataset.\n   - **Evaluation Metrics**: Precision, Recall, and F1-Score were prioritized over accuracy, as these metrics provide a better understanding of the model’s performance on imbalanced datasets. Additionally, the Area Under the ROC Curve (AUC-ROC) was used to evaluate the overall performance.\n\n## Result\nThe model achieved a balanced F1-Score, indicating an effective handling of the minority class. Precision and recall metrics showed a significant improvement after balancing the dataset.\nThe detailed results and analysis can be found in the [Jupyter Notebook here](https://nbviewer.org/gist/rijul007/94fab12ca87d1ddb1ddbe32b6e34704e).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frijul007%2Fclassification-on-imbalanced-data-using-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frijul007%2Fclassification-on-imbalanced-data-using-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frijul007%2Fclassification-on-imbalanced-data-using-python/lists"}