Machine learning · Credit risk

Segmenting 100,000 customers by credit risk

Clustering 100,000 bank customers into six risk profiles, plus a short list of outliers that need a manual review.

RoleData science & analytics
ToolsR · K-means · DBSCAN
TimeframeJul 2026
Impact6 risk segments + a 3.3% high-risk watchlist
clusters.R

Challenge

A single credit score hides the different ways a customer becomes risky. Could 100,000 banking customers be grouped into clear risk profiles a bank can act on?

The synthetic dataset had real-world problems built in: duplicates, impossible values and missing income and credit scores. Those had to be fixed before any model could be trusted.

Approach

I chose nine variables covering repayment capacity, debt and repayment behaviour, and left out demographics because they aren’t direct risk signals and raise fairness concerns.

In R, I cleaned and scaled each variable, tuned K-means with elbow and silhouette analysis, and picked six clusters where the statistics and the business meaning agreed. A DBSCAN pass then flagged customers who fit no cluster at all.

Outcome

Six clear segments, from debt-free high earners to a distressed group of 4.1% of customers with a debt-to-income ratio of 11.57. DBSCAN isolated another 3.3% (3,303 people) whose debt-to-income ratio was 32 times everyone else’s.

The bank gets segments to plan collections around, plus a short list for manual review today. Code and report on GitHub.

By the numbers

6risk segments across 100,000 customers
3.3%flagged as high-risk outliers
32xhigher debt-to-income in the outlier group
Contact

Have a problem like this one? I’m open to data roles and project work, and I’d be glad to talk it through.