This project analyzes employee data from Salifort Motors to identify factors associated with employee turnover and to build models that predict whether an employee is likely to leave the company.
Employee retention is an important issue for organizations because recruiting and training new employees is costly and time-consuming. By identifying the factors that contribute to employee attrition, the HR department can implement strategies to improve employee satisfaction and retention.
This project was completed as part of the Google Advanced Data Analytics Professional Certificate Capstone Project.
The HR department at Salifort Motors collected employee data but needed help answering the following question:
What’s likely to make the employee leave the company?
The goal of the analysis was to:
- Identify factors associated with employee turnover.
- Build predictive models to classify employees likely to leave.
- Provide data-driven recommendations to improve employee retention.
The dataset contains approximately 15,000 employee records and 10 variables describing employee satisfaction, workload, tenure, salary level, and department.
Key variables include:
satisfaction_level– employee reported job satisfactionlast_evaluation– performance evaluation scorenumber_project– number of projects assignedaverage_monthly_hours– average hours worked per monthtime_spend_company– employee tenurework_accident– employee experienced an accident at workpromotion_last_5years– promotion statusdepartment– departmentsalary– salary in U.S. dollarsleft– target variable indicating whether the employee left or stayed
The analysis followed a standard data science workflow:
- Inspected data types and summary statistics.
- Removed duplicate observations.
- Examined potential outliers.
- Renamed variables for clarity.
Visualization techniques included:
- Histograms for numeric variables.
- Bar plots for categorical variables.
- Boxplots comparing features with employee turnover.
- Correlation heatmaps.
- Pairplots for variable relationships.
These visualizations helped identify patterns related to employee attrition.
- One-hot encoding of categorical department variables.
- Ordinal encoding of salary levels.
- Removal of outliers for logistic regression modeling.
Three classification models were implemented:
- Logistic Regression
- Decision Tree
- Random Forest
Hyperparameter tuning was performed using GridSearchCV with cross-validation.
Models were evaluated using:
- Accuracy
- Precision
- Recall
- F1-score
- ROC–AUC
The Random Forest model produced the best predictive performance.
| Metric | Score |
|---|---|
| Accuracy | 98.23% |
| Precision | 98.41% |
| Recall | 90.82% |
| F1 Score | 94.46% |
| ROC–AUC | 0.98 |
Feature importance analysis showed that the most influential predictors of employee turnover were:
- Satisfaction level.
- Number of projects.
- Years at company.
- Average monthly hours.
- Last evaluation score.
- Employees who left typically had lower satisfaction levels.
- Many employees who left were working long hours and managing multiple projects.
- A large proportion of departures occurred among employees with 3–5 years of tenure.
- Higher salary levels were associated with lower turnover rates.
- Employees who received promotions rarely left the company.
These findings suggest that workload and job satisfaction are major drivers of employee attrition.
- Improve work–life balance by reducing excessive workloads and project assignments.
- Monitor employees with 3–5 years of tenure, since turnover peaks during this period.
- Review company evaluation metrics that may implicitly reward long working hours.
- Increase opportunities for career advancement and promotions.
- Set clearer expectations about workload and company culture during employee onboarding.
- Cluster employees using K-means to identify groups with similar characteristics, specially for those with 3 years of employment.
- Evaluate models without the satisfaction variable if these surveys are not frequently done.
- Review evaluation metrics to make sure they are aligned with employees expectations.
salifort-case-study/
├── salifort-motors-case-study-python.ipynb
├── figures
│ ├── confusion_matrix.png
│ ├── decision_tree_plot.png
│ └── feature_importance.png
└── README.md
- Python
- pandas
- NumPy
- seaborn
- matplotlib
- scikit-learn
Capstone project from the Google Advanced Data Analytics Professional Certificate demonstrating:
- Exploratory data analysis.
- Machine learning classification.
- Model evaluation.
- Business-oriented data insights.