DC
Case Study · Live

Salifort Motors — Predicting Employee Attrition

HR Analytics · Machine Learning · Python

Built an ML system that flags at-risk employees with 0.97 AUC — and translates each prediction into a concrete retention action for HR.

0.97
AUC
0.90
F1 Score
0.91
Precision
0.88
Recall
The story behind the data

They had the answers — just not the why.

The HR department at Salifort Motors had a problem they couldn't see clearly. Good people were walking out the door, so HR surveyed their workforce and gathered data on thousands of employees — satisfaction, project loads, hours, tenure, promotions, salary bands.

And then they got stuck. The data sat in a spreadsheet, full of answers but speaking a language no one could read. They had the what, but not the why. So they came to me with a single, very human question:

"What's likely to make an employee leave the company?"

My job was two-fold: understand the real drivers of attrition, and build a model that predicts — before it happens — whether an employee is likely to quit. Spot a flight risk early, and you can act early. Keeping a great employee who was about to leave is one of the highest-return moves an HR team can make.

Executive summary

A champion model HR can act on.

Salifort loses roughly 1 in 6 employees, and replacing each is expensive. Using ~12,000 employee records, a tuned Random Forest flags at-risk employees with high accuracy — letting HR shift from reactive replacement to proactive retention.

MetricScoreWhat it means
AUC0.97Near-perfect ability to separate leavers from stayers
F10.90Strong balance of precision and recall
Precision0.91When it flags someone, it's right 91% of the time
Recall0.88Catches 88% of all actual leavers
Key drivers of turnover

Four distinct clusters of risk.

01

Workload extremes

Project count + monthly hours is the single strongest predictor — splitting into burnout (6–7 projects, 175+ hrs/mo) and boreout (under-used on only 2 projects).

02

The 5-year itch

Attrition risk peaks sharply as employees approach their 4th and 5th years — a predictable window for intervention.

03

The pay gap

Staff in the "low" salary band leave at roughly 4× the rate of other bands — a clear, addressable driver.

04

Unrewarded excellence

High evaluation scores often correlate with higher departure risk — a signal of missing mobility or recognition.

Interactive dashboard

A four-step decision journey.

The findings ship as a guided flow — Overview → Why They Leave → Predictive Model → Profiles & Actions — so a non-technical HR lead moves from the big picture to a specific action in minutes.

Attrition overview KPIs
Attrition overview — workforce KPIs, retention split, and leaver-profile flow
Random Forest confusion matrix and feature importance
Champion model — confusion matrix & the drivers of attrition
Leaver profiles and recommended actions
Leaver profiles & recommended HR actions, with key risk factors
Strategic HR recommendations

From prediction to action.

Ethics first: the model is a tool for support, not surveillance — every prediction triggers a constructive, human-led conversation, never a penalty.
Model comparison

Why Random Forest won.

ModelAccuracyPrecisionRecallF1ROC-AUC
Logistic Regression0.8350.5050.1850.2710.831
Decision Tree0.9840.9710.9300.9500.977
Random Forest0.9860.9910.9260.9570.980

Cross-validated scores. Trained on 8,993 employees, evaluated on 2,998 held-out records.

Technical stack

Tools & workflow.

PythonPandasNumPyMatplotlibSeabornPlotlyscikit-learnLogistic RegressionDecision TreeRandom ForestXGBoostStreamlit