{"id":24644939,"url":"https://github.com/arpanpramanik2003/loan-status-prediction","last_synced_at":"2026-05-17T18:35:55.770Z","repository":{"id":269050129,"uuid":"906272412","full_name":"arpanpramanik2003/loan-status-prediction","owner":"arpanpramanik2003","description":"The **Loan Status Prediction Model** predicts loan approval based on applicant details like income, credit history, and loan amount. It uses data preprocessing, an SVC model, and achieves around 79% accuracy. The trained model is saved for future use.","archived":false,"fork":false,"pushed_at":"2025-01-22T17:50:00.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T18:36:43.086Z","etag":null,"topics":["data-processing","data-science","loan-approval-prediction","loanprediction","machine-learning","mlpipelines","model-evaluation","pickle","predictive-analytics","sklearn","svm-classifier"],"latest_commit_sha":null,"homepage":"https://loan-status-prediction-2upm.onrender.com","language":"Jupyter Notebook","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/arpanpramanik2003.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":"2024-12-20T14:28:34.000Z","updated_at":"2025-01-22T17:56:09.000Z","dependencies_parsed_at":"2024-12-20T15:43:20.899Z","dependency_job_id":"75ca3d6a-3997-4e94-9df2-855c48edf97e","html_url":"https://github.com/arpanpramanik2003/loan-status-prediction","commit_stats":null,"previous_names":["arpanpramanik2003/loan_status_prediction","arpanpramanik2003/loan-status-prediction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Floan-status-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Floan-status-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Floan-status-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpanpramanik2003%2Floan-status-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arpanpramanik2003","download_url":"https://codeload.github.com/arpanpramanik2003/loan-status-prediction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244637099,"owners_count":20485446,"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-processing","data-science","loan-approval-prediction","loanprediction","machine-learning","mlpipelines","model-evaluation","pickle","predictive-analytics","sklearn","svm-classifier"],"created_at":"2025-01-25T14:13:40.684Z","updated_at":"2026-05-17T18:35:55.765Z","avatar_url":"https://github.com/arpanpramanik2003.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💰 Loan Status Prediction with Machine Learning\n\n[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)\n[![Streamlit](https://img.shields.io/badge/Streamlit-1.41.1-FF4B4B.svg)](https://streamlit.io/)\n[![scikit-learn](https://img.shields.io/badge/scikit--learn-1.6.0-F7931E.svg)](https://scikit-learn.org/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](LICENSE)\n\n## 📋 Table of Contents\n- [Overview](#overview)\n- [Features](#features)\n- [Dataset](#dataset)\n- [Technologies Used](#technologies-used)\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Model Architecture](#model-architecture)\n- [Results](#results)\n- [Deployment](#deployment)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n\n## 🎯 Overview\n\nThis project implements an end-to-end machine learning solution for predicting loan approval status based on various applicant features such as income, credit history, loan amount, property area, and more. The project includes comprehensive data analysis, model training with Support Vector Machine (SVM) algorithm, and an interactive web application built with Streamlit for real-time loan approval predictions.\n\n**Key Highlights:**\n- 📊 Analyzed **614 loan application records** from comprehensive loan dataset\n- 🤖 Built and trained a **Support Vector Machine (SVM)** classifier model\n- 🎨 Deployed an interactive **Streamlit** web application\n- 📦 Implemented production-ready ML pipeline with preprocessing\n- 🎯 Achieved **81.02% training accuracy** and **79.17% testing accuracy**\n\n## ✨ Features\n\n### Machine Learning Pipeline\n- **Advanced Preprocessing**: Utilizes `ColumnTransformer` and `Pipeline` for efficient data transformation\n- **Feature Engineering**: \n  - One-Hot Encoding for categorical variables (Gender, Married, Education, Self_Employed, Property_Area, Dependents)\n  - Standard Scaling for numerical features (ApplicantIncome, CoapplicantIncome, LoanAmount, Loan_Amount_Term)\n  - Credit History processing (binary encoding)\n- **SVM Model**: Trained Support Vector Machine classifier with linear kernel for accurate and reliable predictions\n- **Model Persistence**: Serialized model using `pickle` for quick deployment and inference\n\n### Web Application\n- **Interactive UI**: User-friendly Streamlit interface for inputting loan applicant details\n- **Real-time Predictions**: Instant loan approval estimation based on user inputs\n- **Input Validation**: Smart input controls with appropriate ranges and options\n- **Dynamic Features**: \n  - Support for multiple demographic categories\n  - Multiple property area types (Urban, Semiurban, Rural)\n  - Credit history tracking\n  - Dependent count management\n  - Education and employment status options\n\n### Data Analysis\n- **Exploratory Data Analysis (EDA)**: Comprehensive analysis in Jupyter notebooks\n- **Data Visualization**: Plots and charts for understanding data distribution\n- **Missing Value Handling**: Clean dataset preparation\n- **Statistical Analysis**: Descriptive statistics and correlation analysis\n\n## 📊 Dataset\n\n**Source**: Loan_Status.csv\n\n**Dataset Statistics:**\n- **Total Records**: 614 loan applications\n- **Features**: 13 columns (12 features + 1 target variable)\n\n**Features Description:**\n| Feature | Type | Description |\n|---------|------|-------------|\n| `Loan_ID` | String | Unique identifier for each loan application |\n| `Gender` | Categorical | Applicant's gender (Male, Female) |\n| `Married` | Categorical | Marital status (Yes, No) |\n| `Dependents` | Categorical | Number of dependents (0, 1, 2, 3+) |\n| `Education` | Categorical | Education level (Graduate, Not Graduate) |\n| `Self_Employed` | Categorical | Self-employment status (Yes, No) |\n| `ApplicantIncome` | Numerical | Applicant's income in currency units |\n| `CoapplicantIncome` | Numerical | Co-applicant's income in currency units |\n| `LoanAmount` | Numerical | Loan amount in thousands |\n| `Loan_Amount_Term` | Numerical | Loan repayment term in days |\n| `Credit_History` | Binary | Credit history meets guidelines (1: Yes, 0: No) |\n| `Property_Area` | Categorical | Property location (Urban, Semiurban, Rural) |\n| `Loan_Status` | Binary | Loan approval status - **Target Variable** (Y: Approved, N: Not Approved) |\n\n## 🛠️ Technologies Used\n\n### Core Technologies\n- **Python 3.8+**: Primary programming language\n- **Jupyter Notebook**: For data analysis and model development\n- **Streamlit 1.41.1**: Web application framework\n\n### Machine Learning \u0026 Data Science\n- **scikit-learn 1.6.0**: Machine learning algorithms and preprocessing\n- **pandas 2.2.3**: Data manipulation and analysis\n- **numpy 2.2.0**: Numerical computing\n- **scipy 1.14.1**: Scientific computing\n\n### Model Components\n- **SVM (Support Vector Machine)**: Linear kernel classifier\n- **ColumnTransformer**: Feature preprocessing\n- **Pipeline**: ML workflow automation\n- **OneHotEncoder**: Categorical feature encoding\n- **StandardScaler**: Feature scaling\n\n### Deployment \u0026 Utilities\n- **pickle**: Model serialization\n- **joblib 1.4.2**: Efficient model persistence\n\n## 📁 Project Structure\n\n```\nloan-status-prediction/\n│\n├── 📓 Loan_Status_Prediction_Streamlit.ipynb  # Model development and pipeline notebook\n├── 🐍 Loan_Status_Streamlit.py                # Streamlit web application\n├── 📊 Loan_Status.csv                         # Dataset file\n├── 🤖 loan_status_model.pkl                   # Trained model pipeline (serialized)\n├── 📋 requirements.txt                        # Python dependencies\n├── 📄 README.md                               # Project documentation\n├── 📜 LICENSE                                 # Apache 2.0 License\n└── 🚫 .gitignore                              # Git ignore rules\n```\n\n## 🚀 Installation\n\n### Prerequisites\n- Python 3.8 or higher\n- pip package manager\n- Git (for cloning the repository)\n\n### Step 1: Clone the Repository\n```bash\ngit clone https://github.com/arpanpramanik2003/loan-status-prediction.git\ncd loan-status-prediction\n```\n\n### Step 2: Create Virtual Environment (Recommended)\n```bash\n# On Windows\npython -m venv venv\nvenv\\Scripts\\activate\n\n# On macOS/Linux\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n### Step 3: Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n**Note**: The `requirements.txt` file includes all necessary packages:\n- streamlit==1.41.1\n- pandas==2.2.3\n- numpy==2.2.0\n- scikit-learn==1.6.0\n- And other supporting libraries\n\n## 💻 Usage\n\n### Running the Streamlit Web Application\n\n1. **Start the Streamlit server**:\n```bash\nstreamlit run Loan_Status_Streamlit.py\n```\n\n2. **Access the application**:\n   - Open your web browser\n   - Navigate to `http://localhost:8501`\n\n3. **Make Predictions**:\n   - Select applicant's gender from dropdown\n   - Choose marital status\n   - Select education level\n   - Choose self-employment status\n   - Enter applicant income\n   - Enter co-applicant income (if applicable)\n   - Enter loan amount (in thousands)\n   - Enter loan amount term (in days)\n   - Select credit history status\n   - Choose property area\n   - Select number of dependents\n   - Click \"Predict\" button\n   - View the loan approval prediction result\n\n### Working with Jupyter Notebooks\n\n#### Model Training and Pipeline Development\n```bash\njupyter notebook Loan_Status_Prediction_Streamlit.ipynb\n```\nThis notebook covers:\n- Data loading and exploration\n- Exploratory Data Analysis (EDA)\n- Data preprocessing and cleaning\n- Feature engineering and encoding\n- Model training with SVM (linear kernel)\n- Model evaluation on training and test data\n- Pipeline creation with ColumnTransformer\n- Model serialization with pickle\n\n## 🏗️ Model Architecture\n\n### Preprocessing Pipeline\n\n```python\nColumnTransformer:\n  ├── OneHotEncoder (drop='first')\n  │   └── Features: ['Gender', 'Married', 'Education', 'Self_Employed', 'Property_Area', 'Dependents']\n  └── StandardScaler\n      └── Features: ['ApplicantIncome', 'CoapplicantIncome', 'LoanAmount', 'Loan_Amount_Term', 'Credit_History']\n```\n\n### Model Configuration\n\n- **Algorithm**: Support Vector Machine (SVM)\n- **Kernel**: Linear\n- **Target Variable**: Loan_Status (Approved/Not Approved)\n- **Preprocessing**: ColumnTransformer with OneHotEncoder and StandardScaler\n\n### Training Process\n\n1. **Data Loading**: Import Loan_Status.csv dataset\n2. **Data Cleaning**: \n   - Handle missing values\n   - Convert categorical values (Loan_Status: 'Y' to 1, 'N' to 0)\n   - Process Dependents column ('3+' to 4)\n3. **Data Splitting**: Train-test split for model validation\n4. **Pipeline Training**: \n   - Categorical encoding with OneHotEncoder\n   - Numerical scaling with StandardScaler\n   - Model training with SVM linear kernel\n5. **Model Serialization**: Save pipeline as `loan_status_model.pkl`\n\n### Model Workflow\n\n```\nUser Input → Preprocessing Pipeline → SVM Classifier → Loan Approval Prediction\n              (Encoding + Scaling)     (Linear Kernel)    (Approved/Not Approved)\n```\n\n## 📈 Results\n\nThe Support Vector Machine (SVM) model was evaluated using accuracy metrics:\n\n- **Training Accuracy**: **81.02%** - Strong performance on training data\n- **Testing Accuracy**: **79.17%** - Consistent generalization on unseen data\n- **Model Reliability**: Linear SVM provides interpretable decision boundaries\n\n**Key Achievements**:\n- ✅ Successfully handles multiple categorical and numerical features\n- ✅ Provides real-time predictions through web interface\n- ✅ Production-ready ML pipeline with proper preprocessing\n- ✅ Balanced accuracy between training and testing datasets\n- ✅ Automated loan approval decision support system\n\n## 🌐 Deployment\n\n### Local Deployment\nThe application runs locally using Streamlit. Follow the [Usage](#usage) section to start the server.\n\n### Cloud Deployment Options\n\n#### Streamlit Cloud (Recommended)\n1. Push your code to GitHub\n2. Visit [share.streamlit.io](https://share.streamlit.io)\n3. Connect your GitHub repository\n4. Deploy with one click\n\n#### Other Platforms\n- **Heroku**: Deploy with Procfile configuration\n- **AWS EC2**: Deploy on cloud server\n- **Google Cloud Platform**: Use App Engine or Cloud Run\n- **Azure**: Deploy as Web App\n\n**Important Files for Deployment**:\n- `requirements.txt`: Python dependencies\n- `Loan_Status_Streamlit.py`: Main application file\n- `loan_status_model.pkl`: Pre-trained model\n- `Loan_Status.csv`: Dataset (if needed for retraining)\n\n## 🤝 Contributing\n\nContributions are welcome! Here's how you can help:\n\n1. **Fork the repository**\n2. **Create a feature branch**:\n   ```bash\n   git checkout -b feature/YourFeatureName\n   ```\n3. **Make your changes**\n4. **Commit your changes**:\n   ```bash\n   git commit -m \"Add some feature\"\n   ```\n5. **Push to the branch**:\n   ```bash\n   git push origin feature/YourFeatureName\n   ```\n6. **Open a Pull Request**\n\n### Areas for Contribution\n- 🐛 Bug fixes and issue resolution\n- ✨ New features (e.g., more ML models, ensemble methods, visualizations)\n- 📝 Documentation improvements\n- 🎨 UI/UX enhancements\n- 🧪 Additional test cases\n- 📊 More comprehensive data analysis\n- 🔍 Feature importance analysis and model explainability\n\n## 📄 License\n\nThis project is licensed under the **Apache License 2.0** - see the [LICENSE](LICENSE) file for details.\n\n```\nCopyright 2024 Arpan Pramanik\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n```\n\n## 👤 Contact\n\n**Arpan Pramanik**\n\n- 🐱 GitHub: [@arpanpramanik2003](https://github.com/arpanpramanik2003)\n- 📧 Email: [Contact via GitHub](https://github.com/arpanpramanik2003)\n- 💼 Project Link: [https://github.com/arpanpramanik2003/loan-status-prediction](https://github.com/arpanpramanik2003/loan-status-prediction)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n### ⭐ Star this repository if you find it helpful!\n\n**Made with ❤️ by Arpan Pramanik**\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpanpramanik2003%2Floan-status-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farpanpramanik2003%2Floan-status-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpanpramanik2003%2Floan-status-prediction/lists"}