Predictive Analysis of Employee Attrition
Python, Machine Learning, Classification, Scikit-learn, Pandas, SHAP, Explainable AI, HR Analytics, Feature Engineering, GridSearchCV
Predictive Employee Attrition Analysis
Context
As part of a Data Science project applied to Human Resources (HR Analytics), I developed a Machine Learning model to predict the risk of employees resigning from an ESN based on HR data, performance evaluations, and satisfaction surveys.
The objective was to identify the main factors explaining attrition to help HR teams implement preventive actions to improve employee retention.
Objectives
- Merge multiple HR data sources.
- Perform an exploratory data analysis (EDA).
- Build a predictive classification model.
- Handle class imbalance.
- Optimize model performance.
- Explain predictions using Explainable AI.
Architecture
HRIS
│
Annual Evaluations
│
Employee Survey
│
▼
Data Merging
│
▼
Exploratory Analysis (EDA)
│
▼
Data Preparation
│
▼
Feature Engineering
│
▼
Supervised Classification
│
▼
Optimization (GridSearchCV)
│
▼
Interpretation with SHAP
Technologies Used
- Python
- Pandas
- NumPy
- Scikit-learn
- SHAP
- Matplotlib
- Jupyter Notebook
Achievements
Exploratory Analysis (EDA)
- Merging of multiple HR datasets.
- Analysis of employee characteristics.
- Comparison between retained and resigning employees.
- Identification of trends and potential attrition factors.
- Creation of visualizations to facilitate interpretation.
Data Preparation
- Data cleaning and harmonization.
- Handling missing values.
- Encoding categorical variables.
- Selection of relevant variables.
- Creation of training and test sets.
Feature Engineering
Creation and transformation of variables to improve model performance:
- seniority
- employee satisfaction
- performance evaluations
- compensation
- position held
- department
- encoded categorical variables
Modeling
Comparison of several classification models:
- Dummy Classifier
- Logistic Regression
- Random Forest
- Gradient Boosting
Performance evaluation using several metrics adapted to the business context.
Optimization
- Cross-validation
- Fine-tuning with GridSearchCV
- Handling class imbalance
- Adjustment of the decision threshold
- Comparison of performance before and after optimization
Explainable AI
Interpretation of predictions using SHAP:
- global variable importance
- Beeswarm Plot
- Permutation Importance
- individual explanations with Waterfall Plot
This approach makes it possible to precisely explain why an employee presents a high risk of departure.
Demonstrated Skills
Data Science
- Exploratory Analysis (EDA)
- Data Cleaning
- Dataset Merging
- Data Visualization
- Feature Engineering
Machine Learning
- Supervised Classification
- Cross-validation
- Fine-tuning
- Hyperparameter Optimization
- Handling Class Imbalance
Explainable AI
- SHAP
- Feature Importance
- Permutation Importance
- Local and Global Explanations
- Business Interpretation of Models
Python Development
- Pandas
- Scikit-learn
- Processing Pipelines
- Notebook Organization
Business Analysis
- HR Analytics
- Identification of Attrition Factors
- HR Decision Support
- Presentation of Results to a Non-Technical Audience
Outcome
This project allowed me to develop a predictive model capable of estimating the risk of employee attrition while precisely explaining the factors influencing each prediction using Explainable AI techniques. It illustrates a complete Data Science approach, from data integration to result interpretation, to support business decision-making.
Skills Acquired
- Python
- Pandas
- NumPy
- Scikit-learn
- Machine Learning
- Classification
- HR Analytics
- Explainable AI
- SHAP
- Feature Engineering
- Data Cleaning
- EDA
- GridSearchCV
- Cross Validation
- Random Forest
- Gradient Boosting
- Logistic Regression
- Feature Importance
- Permutation Importance
- Jupyter Notebook