{"id":20381416,"url":"https://github.com/nouranhaitham/ml_loanprediction","last_synced_at":"2026-05-10T10:39:30.411Z","repository":{"id":221847508,"uuid":"755528321","full_name":"NouranHaitham/ML_LoanPrediction","owner":"NouranHaitham","description":"A notebook aimed to predict loan eligibility with high accuracy using advanced machine learning models including Logistic Regression and KNN.","archived":false,"fork":false,"pushed_at":"2024-09-16T22:04:41.000Z","size":400,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T07:36:50.559Z","etag":null,"topics":["classification-model","decision-making","insights","knn-classifier","loan-prediction-analysis","logist","logistic-regression","machine-learning","python","regression-models"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/NouranHaitham.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-02-10T13:44:41.000Z","updated_at":"2024-09-16T22:05:43.000Z","dependencies_parsed_at":"2024-02-10T15:30:44.725Z","dependency_job_id":"37f4b0ab-47f7-44f9-95e6-2abd8eaf8a40","html_url":"https://github.com/NouranHaitham/ML_LoanPrediction","commit_stats":null,"previous_names":["niro12-coder/ml_loan_prediction_project","nouranhaitham/ml_loan_prediction_project","nouranhaitham/ml_loanprediction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NouranHaitham%2FML_LoanPrediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NouranHaitham%2FML_LoanPrediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NouranHaitham%2FML_LoanPrediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NouranHaitham%2FML_LoanPrediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NouranHaitham","download_url":"https://codeload.github.com/NouranHaitham/ML_LoanPrediction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241933069,"owners_count":20044638,"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":["classification-model","decision-making","insights","knn-classifier","loan-prediction-analysis","logist","logistic-regression","machine-learning","python","regression-models"],"created_at":"2024-11-15T02:13:46.235Z","updated_at":"2026-05-10T10:39:25.351Z","avatar_url":"https://github.com/NouranHaitham.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loan Prediction Machine Learning Project 📊💡\n\nWelcome to the Loan Prediction Machine Learning Project repository! This project focuses on predicting loan eligibility based on various customer attributes. By leveraging classification algorithms, we aim to develop a robust model that accurately assesses whether a customer qualifies for a loan.\n\n## Overview 🌟\n\nOur project encompasses the following key stages:\n\n1. **Data Exploration:** We conducted an in-depth analysis of the dataset to understand the impact of attributes like marital status, education, and employment status on loan eligibility.\n\n2. **Data Preprocessing:** We handled missing values, outliers, and encoded categorical variables to prepare the data for model training.\n\n3. **Feature Analysis:** We explored trends and correlations in the data, uncovering insights into factors affecting loan approvals.\n\n4. **Model Implementation:** We implemented and compared classification models, including Logistic Regression and K-Nearest Neighbors (KNN), to determine the best-performing algorithm for loan prediction.\n\n5. **Performance Evaluation:** The models were evaluated using accuracy, precision, recall, and F1-score metrics. Logistic Regression emerged as the superior model with an accuracy of 79% compared to KNN's 77%.\n\n6. **Predicting Loan Status:** We used the Logistic Regression model to predict loan status for new customers and analyzed the results to gain further insights.\n\n## Key Features 🚀\n\n- **Logistic Regression:** A powerful classification model that achieved an accuracy of 79%, effectively identifying eligible and ineligible loan applicants.\n  \n- **K-Nearest Neighbors (KNN):** An alternative classification model evaluated using GridSearchCV to find the optimal number of neighbors. Although KNN performed well, Logistic Regression proved to be more accurate.\n\n- **Data Insights:** Analyzed patterns in the new customer data to identify trends such as the percentage of married individuals in semiurban areas who obtained loans.\n\n- **Visualization:** Utilized visualizations to understand the distribution of loan status across different attributes like marital status and employment.\n\n## Getting Started 🚀\n\n1. **Clone the Repository:**\n```bash\ngit clone https://github.com/yourusername/loan-prediction-project.git\n```\n2. **Navigate to the Project Directory:**\n  ```bash\n  cd loan-prediction-project\n  ```\n3. **Install Dependencies:**\n  ```bash\n  pip install -r requirements.txt\n  ```\n4. **Run Data Analysis and Model Training Scripts:**\n   \nTo explore and preprocess the data:\n```bash\njupyter notebook data_analysis.ipynb\n```\nTo train and evaluate the models:\n```bash\npython train_models.py\n```\n\n## Performance Metrics 📈\n\n- **Logistic Regression:**\n  - **Accuracy:** 79%\n  - **Precision:** \n    - Class 0: 0.95\n    - Class 1: 0.76\n  - **Recall:** \n    - Class 0: 0.40\n    - Class 1: 0.99\n  - **F1-score:** \n    - Class 0: 0.56\n    - Class 1: 0.86\n\n- **K-Nearest Neighbors (KNN):**\n  - **Accuracy:** 77%\n  - **Precision:** \n    - Class 0: 0.81\n    - Class 1: 0.76\n  - **Recall:** \n    - Class 0: 0.42\n    - Class 1: 0.95\n  - **F1-score:** \n    - Class 0: 0.55\n    - Class 1: 0.84\n\n## Insights and Analysis 🔍\n\n- The Logistic Regression model demonstrates superior performance compared to K-Nearest Neighbors (KNN) with a higher accuracy of 79% versus 77%.\n- Key insights from the new customer data reveal significant trends, such as the percentage of married individuals in semiurban areas who secured loans.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnouranhaitham%2Fml_loanprediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnouranhaitham%2Fml_loanprediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnouranhaitham%2Fml_loanprediction/lists"}