SHUBHAM KUMAR / CASEFILE
Portfolio All projects
FILE / PROJECT REPORTCASE NO. 002 · JUN '26

HR Employee Attrition Analysis

Why do employees leave, and which factors actually predict it? This case turns the IBM HR Analytics dataset into a retention question a team can investigate.

The useful number is not accuracy.

For a tool that flags potential leavers, recall on the leaver class matters more than a better-looking overall accuracy score.

Segment first. Model second.

Use the filters to inspect the original sample by department and overtime status. Rates recalculate within the selected view.

Showing all employees. Rates are calculated within the selected view.

Attrition by overtime

Which operational condition has the clearest gap?

PRIMARY SIGNAL
Higher observed rateLower observed rate

Attrition rate by job role

Which roles need rate-based attention rather than raw-count attention?

SEGMENTATION
Observed attrition rateHigher-rate segment

Attrition by tenure band

Does risk concentrate in the early-career window?

TENURE
Employees grouped by years at company

Model performance

Recall is the decision metric when the goal is to catch actual leavers.

Focus
Logistic RegressionRandom ForestSelected metric: recall

Role-level detail table

Rates are more useful than raw departures when role sizes differ.

Sort by

Three signals worth acting on.

The original write-up intentionally separates descriptive EDA from model performance and avoids pretending that a small HR sample proves causation.

01 / OVERTIME

Overtime is the strongest observed gap.

The original CSV gives 30.5% attrition among overtime employees versus 10.4% without overtime. The PDF recommends treating overtime as the primary retention lever.

02 / TENURE

The early-career window deserves focus.

The PDF reports median tenure of 3 years for leavers versus 6 years for stayers. That points toward targeted 0–3 year retention work rather than a broad company-wide intervention.

03 / EVALUATION

Recall changes the model decision.

Random Forest reaches 86% accuracy but 21% recall; Logistic Regression reaches 72% accuracy but 56% recall. For identifying actual leavers, the lower-accuracy model is more useful.

Turn the signal into a focused next test.

The data supports a practical sequence, not a definitive causal story.

  1. Audit overtime intensity and manager context. Treat overtime as the first investigation lever, then add schedule, workload, and manager notes that the current dataset does not contain.
  2. Design an early-career retention check. Focus the 0–3 year window with onboarding, manager check-ins, and exit-risk monitoring rather than spreading resources evenly across tenure.
  3. Use recall-first model evaluation. If a flagging tool is built, prioritize the leaver class and monitor precision/recall trade-offs instead of optimizing for accuracy alone.

Dataset

Original `HR_Employee_Attrition.csv`: 1,470 employees and 35 source features covering demographics, compensation, satisfaction, and tenure.

Approach

Removed constant columns, checked nulls and duplicates, mapped the target, compared attrition rates by role/overtime/tenure, and used balanced Logistic Regression and Random Forest models.

Tools

Python · pandas · NumPy · Matplotlib · Seaborn · scikit-learn. The displayed population rates are recalculated from the original repository CSV.

Limitation

Attrition rates and feature importance show observed association within this sample. The original PDF notes that exit-interview text, manager notes, and engagement-survey data would be needed to explain why employees leave.

ESC