Skip to content

samvik07/Credit-Card-Default-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Default Prediction Model

A machine learning project to predict credit card defaulters using various models and evaluation strategies. Focuses on domain-specific metrics like Recall (Class 1) and Precision (Class 0), beyond just accuracy.

Project Structure

  • eda/: Exploratory data analysis notebook
  • data/: Data loading utilities
  • preprocessing/: Feature encoding, SMOTE, and other transformations
  • modeling/: Model training and tuning scripts
  • evaluation/: Evaluation and metric plotting

Models Used

  • Logistic Regression
  • Random Forest
  • XGBoost
  • Hyperparameter tuning using:
    • Accuracy (default)
    • Domain-specific custom score

Evaluation Focus

  • ROC AUC Score (model's ability to distinguish between the 2 classes: default/non-default)
  • Recall of Class 1 (catching defaulters)
  • Precision of Class 0 (preserving creditworthy leads)

Key Learnings

  • Accuracy can be misleading in imbalanced datasets.
  • Business context determines the right evaluation metric.
  • Tuning of parameters has to be aligned with the right evaluation metric. In this case, custom metric has been used during tuning, with focus on AUC, Recall (1), and Precision (0).

How to Run

# Create environment (optional)
pip install -r requirements.txt

# Run full pipeline
python main.py

About

Credit card default prediction model in Python's Scikit-Learn --- A comparison of logistic regression, random forest and XGBoost models

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors