Employee Retention using Data Science

Tarique Akhtar
Towards Data Science
5 min readOct 15, 2020

--

Photo by Tim Mossholder on Unsplash

Hiring and retaining top talent is an extremely challenging task that requires capital, time and skills. Small business owners spend 40% of their working hours on tasks that do not generate any income such as hiring process for new employees.

In this article, we will implement Data Science techniques to improve the human resources department.

We are going to predict which employees in a company are more willing to leave the organization.

So in this case study, we’re going to learn below points.

  1. Why do employees want to leave?
  2. Why do they want to stay?
  3. How can we make them motivated?

and much more ….:)

We have got the dataset from kaggle.com which will be used for this case study.

Here is the link for the same: https://www.kaggle.com/pavansubhasht/ibm-hr-analytics-attrition-dataset

We know Python is a very useful tool for Data analysis. We will use it to answer above questions.

You can get the full python code on my GitHub: https://github.com/Tariqueakhtar/Machine-Learning/tree/master/HR_Department_Solution

Let’s jump directly to some of the insights from data.

Data Summary

Our data contains 35 features in total, each has 1470 data points

35 features in total, each contains 1470 data points (Image by Author)

Let's see how many employees left the company!

16% employees left the organization (Image by Author)

16% employees left the organization.

After digging more into the data, we got below findings.

1. Age vs Attrition Analysis

Age vs Attrition (Image by Author)

People of age of 29 and 31 years left the company more frequently. Although the number of employees in age group of 18 to 23 is less but the attrition rate is also high in this group. Also, as age increases the chances of leaving the company decreases.

2. Marital Status vs Attrition

Marital Status vs Attrition (Image by Author)

Single employees tend to leave compared to married and divorced

3. Job Role vs Attrition

Job Role vs Attrition (Image by Author)

Sales Representatives and Lab Technician tend to leave compared to any other job.

4. Job Involvement vs Attrition

Job Involvement vs Attrition (Image by Author)

Less involved employees tend to leave the company. If you notice Jobinvolvement = 1, it has more attrition as compared to total population under this category.

5. Experienced vs Attrition

Experienced vs Attrition (Image by Author)

Less experienced (low job level i.e JobLevel =1) tend to leave the company.

6. Distance from Home vs Attrition

Experienced vs Attrition (Image by Author)

People staying far (more than 10km) from office more likely to leave company. You can notice the red line is above blue line after 10 in the x-axis i.e Distance from Home.

7. Years with Current manager vs Attrition

Years with Current manager vs Attrition (Image by Author)

Employee with small span of time with Current manager are more likely to leave the company. You can notice the red line is above blue line at the starting of x-axis i.e Years with Current manager. However as we increase the number of years, the blue line tends to supersede the red line, which means that as you go beyond 4 to 15 years, the number of employees who actually tend to stay is more than the number of employees who actually leaves the company.

8. Total Working Years vs Attrition

Total Working Years vs Attrition (Image by Author)

Employees with less number of years(0 to 6 years) with the company tend to leave the company. You can notice the red line is above blue line at the starting of x-axis i.e Total Working Years. However as you go beyond 6 years, you will find that the blue line tend to supersede which means the employees tend to stay as you increase the total working years.

9. Gender vs. Monthly Income

Gender vs. Monthly Income (Image by Author)

You can see here the average salary is almost quite comparable between male and female, that’s actually a great thing.

Gender pay equality is actually critical and very important thing for any company. Actually, by looking into box-plot it seems that females actually get paid even more than the males here.

10. Monthly income vs. job role

monthly income vs. job role (Image by Author)

The above box-plot shows that the employees who work as managers tend to get a lot more which obviously makes sense. And it seemed that if you work as Research scientist and Lab technician, the salary range is almost same for both job role.

If you’re doing Sales Representative work, you get paid a lot less compared to the Managers and the Research Directors. The human resources are somewhere in between here as well.

Conclusion:

You can see how data analysis using different charts and visualizations helped in getting answers to many questions.

This analysis will help the company to make some employee policies and modify them if required. Even this will help to make some new employee engagement program that help employee stay more longer.

Reference: https://www.kaggle.com/pavansubhasht/ibm-hr-analytics-attrition-dataset

Thanks for reading!!!

--

--