1 of 12

Credit Scoring with Machine Learning

Google Colab Portfolio

Phone : +62 851 7227 0851

Email : adedesfrianto@gmail.com

Portfolio : linktr.ee/adedesfrianto

LinkedIn : linkedin.com/in/adedesfrianto

2 of 12

Background & Objective

Background

  • Challenges with Traditional Credit Scoring:
    • Depends on outdated methods with limited data inputs.
    • Struggles to uncover hidden patterns in applicant profiles.
  • Why Machine Learning Matters:
    • Processes diverse data sources such as demographics, financial history, and employment.
    • Identifies intricate trends to make precise credit predictions.
  • Business Impact:
    • Enables faster loan approvals, enhancing customer satisfaction.
    • Reduces risks by supporting data-driven decisions with better accuracy.

Objective

  • Business Goal: Enhance credit risk assessment to:
    • Minimize loan defaults and maximize portfolio quality.
    • Improve efficiency and accuracy in evaluating applicant creditworthiness.
  • Outcome: Classify applicants as "Good" or "Bad" based on repayment potential, driving better lending decisions.

3 of 12

Datasets Used

4 of 12

Data Cleaning

Dropped Column OCCUPATION_TYPE

  • High percentage of missing data (30.60%).
  • Missing values could reduce model accuracy and introduce bias.

5 of 12

Data Cleaning

Merge Datasets:

  • Performed a left join on credit and application DataFrames using the ID column.

Filter Rows:

  • Removed rows where STATUS is X, focusing on active credit behavior.

Map STATUS Column:

  • Converted STATUS values to numerical:
    • C, 0 = 1 (Good Credit)
    • 1, 2, 3, 4, 5 = 0 (Bad Credit)

Handle Missing Data:

  • Dropped rows with null values to maintain data integrity.

6 of 12

exploratory data analysis

Dropped Column FLAG_MOBIL

Column contains only a single unique value.

Dropped Column FLAG_EMAIL

High imbalance:

pedictive power contributes minimal value to the model.

Dropped Column ID

Unique identifier with no predictive significance.

Retaining it could introduce noise and increase the risk of overfitting.

7 of 12

exploratory data analysis

8 of 12

Target Balancing

Initial Data Imbalance

  • Proportions in STATUS (Target):
    • 1 (Good Credit): 98.17%
    • 0 (Bad Credit): 1.83%
  • Extreme imbalance could lead to biased model predictions favoring the majority class.

Oversampling with SMOTE

  • Method Used:
    • Synthetic Minority Oversampling Technique (SMOTE) to balance the dataset.

9 of 12

Model Building and Evaluation

1. Data Preparation

  • Features (X): Excluded the target column STATUS.
  • Target (y): Assigned STATUS column as the target variable.

2. Train-Test Split

  • Split the dataset into:
    • Training set (80%)
    • Testing set (20%)
    • Ensured reproducibility with a random seed: random_state=42.

4. Model Development

  • Models Trained:
    • XGBoost Classifier
    • Random Forest Classifier
  • Trained both models on the balanced training data for optimal performance.

10 of 12

Model Building and Evaluation

Observations

  • Random Forest outperforms XGBoost in identifying Bad Credit (higher F1-Score: 0.23 vs. 0.17).
  • Both models excel in Good Credit, but Random Forest has better Recall (93%).
  • Random Forest achieves higher overall accuracy (92%) and more balanced performance.

Conclusion

Random Forest is the preferred model, with stronger performance on minority class predictions.

11 of 12

Model Building and Evaluation

Random Forest Feature Importance

Top Features Contributing to Model

  1. DAYS_BIRTH: 20.09%
  2. MONTHS_BALANCE: 15.74%
  3. DAYS_EMPLOYED: 15.33%
  4. AMT_INCOME_TOTAL: 14.13%
  5. CNT_FAM_MEMBERS: 6.45%

Key Observations

  • Age (DAYS_BIRTH) remains the most influential feature.
  • MONTHS_BALANCE and DAYS_EMPLOYED are also critical for predicting credit behavior, emphasizing financial activity timelines.
  • Lesser importance is assigned to features like Car, Realty, and Phone ownership.

12 of 12

THANKS

Google Colab Portfolio

Phone : +62 851 7227 0851

Email : adedesfrianto@gmail.com

Portfolio : linktr.ee/adedesfrianto

LinkedIn : linkedin.com/in/adedesfrianto

CREDITS: This presentation template was created by Slidesgo, including icons by Flaticon, and infographics & images by Freepik and illustrations by Storyset