{"id":25907939,"url":"https://github.com/utkarsh-284/credit-default-risk","last_synced_at":"2026-04-21T09:31:58.675Z","repository":{"id":279965191,"uuid":"940575245","full_name":"utkarsh-284/Credit-Default-Risk","owner":"utkarsh-284","description":"This Repository deals with Credit Risk evaluation and prediction of default","archived":false,"fork":false,"pushed_at":"2025-02-28T13:28:24.000Z","size":2236,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T19:10:02.990Z","etag":null,"topics":["credit-card","credit-risk","default","econometrics","essemblelearning","exploratory-data-analysis","jupyter-notebook","logistic-regression","machine-learning","neural-network","python","support-vector-machines"],"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/utkarsh-284.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":"2025-02-28T12:21:16.000Z","updated_at":"2025-02-28T13:30:57.000Z","dependencies_parsed_at":"2025-02-28T19:10:07.812Z","dependency_job_id":"43177f72-2ab0-4890-a805-664d03debb22","html_url":"https://github.com/utkarsh-284/Credit-Default-Risk","commit_stats":null,"previous_names":["utkarsh-284/credit-default-risk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FCredit-Default-Risk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FCredit-Default-Risk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FCredit-Default-Risk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FCredit-Default-Risk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utkarsh-284","download_url":"https://codeload.github.com/utkarsh-284/Credit-Default-Risk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241622600,"owners_count":19992504,"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":["credit-card","credit-risk","default","econometrics","essemblelearning","exploratory-data-analysis","jupyter-notebook","logistic-regression","machine-learning","neural-network","python","support-vector-machines"],"created_at":"2025-03-03T07:15:44.806Z","updated_at":"2026-04-21T09:31:58.659Z","avatar_url":"https://github.com/utkarsh-284.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Credit Default Risk Analysis\n\n## Overview\nThis project analyzes credit card default risk using machine learning techniques on a dataset of 30,000 Taiwanese credit card clients. The analysis includes comprehensive exploratory data analysis, statistical modeling, and machine learning approaches to predict credit card defaults and identify key risk factors.\n\n## Key Findings\n\n### 🎯 **Best Model Performance**\n- **Support Vector Machine (SVM)**: 80.5% accuracy, 0.70 AUC-ROC score\n- **Ensemble Methods**: Voting Classifier achieved 80.5% accuracy\n- **Neural Network**: Deep learning model achieved 80.0% accuracy\n\n### 📊 **Critical Risk Factors**\n1. **Recent Payment Status (PAY_0)**: Most predictive feature (coefficient = 0.515)\n2. **Payment History (PAY_2)**: Secondary predictor (coefficient = 0.111)\n3. **Bill Amount (BILL_AMT1)**: Financial capacity indicator\n4. **Credit Limit (LIMIT_BAL)**: Risk tolerance measure\n5. **Age Demographics**: U-shaped risk curve (highest for young adults and seniors)\n\n### 🔍 **Demographic Insights**\n- **Gender**: Females take more loans but have lower default rates\n- **Education**: University graduates borrow most, but all education levels show similar default proportions\n- **Age**: Peak borrowing at 25-30 years, with highest default risk for young adults and seniors\n- **Marital Status**: Singles borrow more but have higher default rates than married individuals\n\n## Dataset Details\n\n**Source**: [UCI Machine Learning Repository](https://archive.ics.uci.edu/dataset/350/default+of+credit+card+clients)\n\n### Variables:\n- **Demographic Features**: Credit limit (`LIMIT_BAL`), gender (`SEX`), education (`EDUCATION`), marital status (`MARRIAGE`), age (`AGE`)\n- **Payment History**: Repayment status for past 6 months (`PAY_0` to `PAY_6`)\n- **Billing Statements**: Bill amounts for past 6 months (`BILL_AMT1` to `BILL_AMT6`)\n- **Payment Amounts**: Amounts paid in past 6 months (`PAY_AMT1` to `PAY_AMT6`)\n- **Target Variable**: DEFAULT (binary indicator: 1 = default, 0 = non-default)\n\n## Methodology\n\n### Data Preprocessing\n- **Missing Values**: No missing values detected\n- **Categorical Variables**:\n  - EDUCATION: Categories 0, 5, 6 merged into \"Others\"\n  - MARRIAGE: Category 0 merged into \"Others\"\n- **Feature Engineering**:\n  - Created `TOTAL_BILL_AMT` (sum of all bill amounts)\n  - Created `TOTAL_PAY_AMT` (sum of all payment amounts)\n- **Outlier Removal**: Applied IQR method, reducing dataset from 30,000 to 25,174 observations\n\n### Exploratory Data Analysis (EDA)\n- Comprehensive demographic analysis revealing risk patterns\n- Financial behavior correlation analysis\n- Age-based risk segmentation\n- Payment history impact assessment\n\n### Statistical Analysis\n- **Logistic Regression**: Pseudo R-squared = 0.121 (12.1% variance explained)\n- **Key Statistical Findings**:\n  - PAY_0 highly significant (p \u003c 0.001)\n  - PAY_2 significant (p \u003c 0.001)\n  - BILL_AMT1 significant (p \u003c 0.001)\n\n### Machine Learning Models Tested\n\n| Model | Accuracy | AUC-ROC | Performance Rank |\n|-------|----------|---------|------------------|\n| **Support Vector Machine** | **80.5%** | **0.70** | **🥇 Best** |\n| Voting Classifier | 80.5% | - | 🥈 Second |\n| Random Forest | 80.0% | - | 🥉 Third |\n| Deep Neural Network | 80.0% | - | 🥉 Third |\n| Logistic Regression | 79.3% | - | 4th |\n| Lasso Regression | 76.2% | - | 5th |\n| Elastic Net | 76.3% | - | 6th |\n\n## Business Impact\n\n### Risk Management Applications\n1. **Early Warning System**: Monitor recent payment status for immediate intervention\n2. **Credit Limit Optimization**: Adjust limits based on risk scores\n3. **Customer Segmentation**: Target high-risk demographics proactively\n4. **Collection Strategy**: Prioritize collection efforts based on risk assessment\n\n### Operational Benefits\n- **Proactive Risk Mitigation**: Identify high-risk clients before default\n- **Reduced Financial Losses**: Targeted interventions based on risk scores\n- **Improved Customer Retention**: Personalized risk-based strategies\n- **Optimized Credit Policies**: Data-driven lending decisions\n\n## Model Performance Analysis\n\n### Support Vector Machine (Best Model)\n- **Accuracy**: 80.5%\n- **AUC-ROC**: 0.70\n- **Advantages**: \n  - Excellent for binary classification\n  - Handles non-linear relationships\n  - Robust to outliers\n- **Business Value**: Highest predictive power for default risk identification\n\n### Feature Importance Ranking\n1. **PAY_0** (Most recent payment status) - Primary predictor\n2. **PAY_2** (2nd most recent payment status) - Secondary predictor  \n3. **BILL_AMT1** (Most recent bill amount) - Financial capacity indicator\n4. **LIMIT_BAL** (Credit limit) - Risk tolerance indicator\n5. **Age-related features** - Life stage risk factors\n\n## Technical Implementation\n\n### Dependencies\n```\nPython 3.7+\npandas, numpy, matplotlib, seaborn\nscikit-learn, statsmodels\ntensorflow (for neural networks)\n```\n\n### Key Libraries Used\n- **Data Processing**: Pandas, NumPy\n- **Visualization**: Matplotlib, Seaborn\n- **Statistical Analysis**: Statsmodels\n- **Machine Learning**: Scikit-learn\n- **Deep Learning**: TensorFlow\n\n## Future Work\n\n### Model Enhancements\n- **Advanced Algorithms**: XGBoost, LightGBM implementation\n- **Class Imbalance**: SMOTE or cost-sensitive learning\n- **Feature Engineering**: Payment-to-bill ratios, temporal trends\n- **Cross-validation**: Robust model validation\n\n### Data Improvements\n- **Additional Features**: Macroeconomic indicators, employment data\n- **Real-time Data**: Live transactional data integration\n- **Geographic Expansion**: Multi-market validation\n- **Temporal Analysis**: Time series modeling\n\n### Deployment Considerations\n- **API Development**: Real-time prediction endpoints\n- **Dashboard Creation**: Risk visualization interface\n- **Model Monitoring**: Performance tracking and drift detection\n- **Scalability**: Cloud deployment for production use\n\n## Files Structure\n```\nCredit Risk Analysis/\n├── README.md                           # Project overview and documentation\n├── MODEL_REPORT.md                     # Comprehensive model analysis report\n├── Credit_Default_Prediction.ipynb     # Complete Jupyter notebook analysis\n└── content/\n    ├── default of credit card clients.xls    # Original dataset\n    └── default+of+credit+card+clients.zip    # Compressed dataset\n```\n\n## Quick Start\n\n1. **Clone the repository**\n2. **Install dependencies**: `pip install pandas numpy matplotlib seaborn scikit-learn statsmodels tensorflow`\n3. **Open the Jupyter notebook**: `Credit_Default_Prediction.ipynb`\n4. **Run the analysis**: Execute cells sequentially for complete analysis\n\n## Results Summary\n\n### Model Performance\n- **Best Model**: Support Vector Machine (80.5% accuracy)\n- **Key Predictor**: Recent payment status (PAY_0)\n- **Business Impact**: Proactive risk identification and mitigation\n\n### Key Insights\n- Recent payment behavior is the strongest default predictor\n- Age shows U-shaped risk pattern (highest for young adults and seniors)\n- Higher credit limits correlate with lower default rates\n- Gender and education show nuanced risk relationships\n\n## Contributor\n**Utkarsh Bhardwaj**  \n**Publish Date**: February 28, 2025  \n**Contact**: ubhardwaj284@gmail.com\n\n[LinkedIn](https://www.linkedin.com/in/utkarsh284/) | [GitHub](https://github.com/utkarsh-284)\n\n---\n\n**Note**: This analysis provides a solid foundation for credit risk assessment. The SVM model with 80.5% accuracy can be effectively deployed for real-time default prediction and risk management applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkarsh-284%2Fcredit-default-risk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futkarsh-284%2Fcredit-default-risk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkarsh-284%2Fcredit-default-risk/lists"}