This project analyzes and models the HMEQ dataset to predict whether a loan applicant will default.
It combines data cleaning, visualization, and machine learning classification using Pythonβs top data science libraries.
The HMEQ (Home Equity) dataset contains information on loan applicants, their credit history, and default status.
Our goal: build a robust ML model to predict loan default and identify the key factors influencing credit risk.
- Handling missing values with SimpleImputer
- Encoding categorical variables using LabelEncoder
- Splitting the dataset into train/test sets
- Visualizing distributions and correlations with seaborn and matplotlib
- Detecting outliers and understanding feature importance
Implemented and tuned several ML models:
- π³ Decision Tree Classifier
- π² Random Forest Classifier
- π Gradient Boosting Classifier
Used GridSearchCV for hyperparameter optimization.
- β Accuracy score
- π ROC & Precision-Recall Curves
- π Confusion Matrix
- π Classification Report
- Gradient Boosting delivered the highest accuracy and AUC
- Feature importance analysis reveals the top predictors of default
- Missing value treatment and encoding significantly improved performance
| Category | Tools |
|---|---|
| Language | Python π |
| Data | Pandas, NumPy |
| Visualization | Matplotlib, Seaborn |
| ML Models | scikit-learn |
| Optimization | GridSearchCV |
| Metrics | ROC, AUC, Confusion Matrix |
- Clone the repository
git clone https://github.com/<your-username>/hmeq-ml.git cd hmeq-ml