Data
03 / BI and data analyst· Analytics

A people-analytics build for a 2,500-person IT services firm: attrition, hiring, engagement and pay equity, plus a flight-risk score that never sees gender.

Year
Oct 2026
Status
Live
Stack
Python, DuckDB, SQL, scikit-learn
flight risk
AUC 0.658
HR analytics workbench: filters, five KPIs, six views, the highest flight risks and the levers behind them
01

HR data lives in separate systems: people and job changes in the HRIS, pay in payroll, requisitions in the ATS, anonymous scores in the survey tool. Leadership's questions cut across all of them: how fast are we losing people, which leavers hurt, are we paying fairly, and who is likely to go next?

02

A seeded generator simulates the firm month by month, with planted effects to find: resignations driven by pay against market, slow raises, long commutes and bench time; women paid 3.5% less for the same job. DuckDB builds a point-in-time monthly snapshot of every employee with ASOF joins, so nothing leaks from the future. A scikit-learn model trained on snapshots up to September 2023 and tested on March 2024 onwards scores everyone on the books and lists the levers HR could change. The Tableau workbook is written as XML by Python, matched to the file Tableau itself saves.

03

15 checks gate the export, each proven by breaking the data on purpose. Tableau's numbers match an independent DuckDB calculation for the whole firm and three filtered views, 20 values out of 20. The model reaches ROC AUC 0.658; its top 10% of scores catch 20.4% of leavers. Gender, age, region and university are never features, and the fairness table shows why women are still flagged more: they are paid less. Pay equity recovers the planted gap: 74.9% raw, 97.7% like for like.

04

OUT-OF-TIME TESTthe model is judged on years it never saw
RISK AS A RANKthe model over-predicts calm years; ranks stay honest
WORKBOOK AS CODETableau's own save as the spec; the XML rebuilds byte for byte