DATA SCIENCE · INDEPENDENT PROJECT · 2026
Employee Attrition Analysis
The situation
Salifort Motors is a fictional automotive manufacturer with a real problem: the company's HR department had collected years of employee survey data and had no idea what it was telling them. Turnover was high, exit interviews produced anecdotes rather than patterns, and leadership wanted to know two things. Why are people leaving, and can we see it coming before a resignation lands on a desk?
The dataset is public. The company is not real. The analytical problem is one I have seen in every organisation I have worked with: data that has been collected diligently and never interrogated.
What I did
I worked the dataset the way I would work a client engagement, which meant the first decision was a boring one. Of 14,999 records, 3,008 were exact duplicates. Removing them left 11,991, and every finding below rests on that decision being documented rather than assumed.
The analysis I expected to run was a single-profile one: find the dissatisfied employees, predict who leaves. The data refused that framing. Plotting satisfaction against monthly hours produced two separate clusters of leavers, not one. The first was a group working 250 to 310 hours per month across six or seven projects, leaving despite moderate satisfaction scores. These were not unhappy people. They were people whose workload had become unsustainable, and dissatisfaction was a symptom rather than the cause. The second cluster was the opposite: minimal hours, few projects, low satisfaction, employees who had disengaged well before they resigned.

That distinction changed what the analysis was for. Two mechanisms mean two interventions, and a recommendation aimed at the average leaver would have missed both groups. Most of the work after that point went into confirming the split held up rather than into improving a model score.
On modelling, the decision that mattered was the metric. I fit a logistic regression first as a baseline: 0.77 recall on the leaving class at 0.33 precision, workable but noisy. The Random Forest model that replaced it reached 0.93 recall at 0.99 precision, enough of a gap to justify the added complexity. Accuracy is the default metric and it is the wrong default here. A false negative means an employee leaves without anyone noticing the warning signs, which costs the company a replacement hire. A false positive means a manager has an unnecessary conversation. The costs are not symmetrical, so I optimised for recall on the leaving class throughout, rather than reporting a single headline accuracy figure.
I wrote the code myself, deliberately, rather than generating it. The point of the exercise was to be able to defend every line of it.
How it went
The model surfaces the large majority of employees who go on to leave, which is enough to be operationally useful: run it quarterly, get a list, act on it before notice periods start.
The findings that came out alongside it were sharper than the model. Attrition peaks between years three and five of tenure, which suggests employees hit a perceived ceiling early rather than gradually losing interest. Only 2.1% of employees had been promoted within five years. Employees in the lowest salary band left at roughly four times the rate of the highest.
Those three facts point at the same thing, and none of them require a model to act on. The five recommendations I delivered covered workload caps for high performers showing burnout signals, compensation review focused on the three to five year window, visible promotion pathways, stay interviews timed to the highest-risk tenure points, and separate retention strategies for the two leaver profiles.
The honest limitation: this is a single snapshot of one dataset. A real engagement would want longitudinal data and access to the people the numbers describe.
93%
recall, Random Forest model
What it proves
That I will tell you what your data actually says, including when it contradicts the question you asked. The valuable output here was not the model, it was noticing that "why do people leave" had two answers and that treating it as one would have produced advice that helped nobody.