SlideShare a Scribd company logo
1 of 15
METHODOLOGY FOR SOLVING
EMPLOYEE ATTRITION PROBLEM
BY
DANIEL ITA ESSIEN
Proof of Concept Project
Hash-Analytic-Python-Analytics-Problem-case-study
Methodology For Solving the Employee
Attrition Problem
• To solve the Employee attrition problem, lets
consider what Employee attrition means.
• According to Chiradeep, a HR Technologist,
“Employee attrition occurs is defined as the
natural process by which employees leave the
workforce – for example, through resignation
for personal reasons or retirement – and are
not immediately replaced.”
Data Loading
Data Analysis and Visualization
Cluster Analysis
Building Predication Model
Evaluating Model Performance
Conclusion
Methodology for solving employee attrition case by Daniel Ita Essien
2
Data Loading
• To make data visualization easy, a new column “left” with values “1” was added to the
Existing Customers Sheet, and the same column was added to Employees who have left
with values “0”.
• The “‘display.max_columns’, None” and “‘display.width’, None” argument makes display
of all columns in a DataFrame possible when printing.
• First importation of modules that will be needed.
#importing libraries
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
3
Methodology for solving employee attrition case by Daniel Ita Essien
Data Loading
excelfile = pd.ExcelFile("Problem case Study1.xlsx") #reading of excel file
dframe = excelfile.parse("Existing employees") #specifies the sheet
dframe2 = excelfile.parse("Employees who have left") #specifies the sheet
both_sheets = [dframe, dframe2] #Takes in both sheets
NewSheet = pd.concat(both_sheets) #merges both sheets by concatenation
#creation of new excel file with concatenated sheets maintaining the indexes
combined = NewSheet.to_excel('combined.xlsx', index=False)
• Operations involving loading data from excel sheet is explained below in the comments
with the codes.
• After creation of new excel sheet “combined.xlsx”, the values of the default index in the
sheet which is “Emp Id” was changed to a sequential numbers “1 – 14999” to aid
visualization with Tableau Public, Community version
4
Methodology for solving employee attrition case by Daniel Ita Essien
Data Analysis
• The new excel sheet can be viewed thus:
excelfile = pd.ExcelFile("combined.xlsx")
all_Employees = excelfile.parse("Sheet1")
print all_Employees
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 14999 entries, 0 to 14998
Data columns (total 11 columns):
Emp ID 14999 non-null int64
satisfaction_level 14999 non-null float64
last_evaluation 14999 non-null float64
number_project 14999 non-null int64
average_montly_hours 14999 non-null int64
time_spend_company 14999 non-null int64
Work_accident 14999 non-null int64
promotion_last_5years 14999 non-null int64
dept 14999 non-null object
salary 14999 non-null object
left 14999 non-null int64
dtypes: float64(2), int64(7), object(2)
memory usage: 1.3+ MB
• To know more about the loaded dataset:
all_Employees.info()
• Prints out the data by the right which is self
explanatory
5
Methodology for solving employee attrition case by Daniel Ita Essien
Data Analysis
• The code below prints out the mean value of all Employee attributes using the
groupby( ) function to specify Employees that left and those staying.
left = all_Employees.groupby('left')
print "Employees that left have the value of 0"
print "Existing Employees have the value of 1"
print "***************************************"
print "Mean values for all Employee attributes"
print left.mean()
• Prints out:
• With the above, you can notice that Employees who left had low satisfaction level, low promotion rate,
spent more time, carried out more projects compared to those that stayed.
6
Methodology for solving employee attrition case by Daniel Ita Essien
Data Visualization
• The following plots were visualized using Tableau Public Community Edition
so has to have a more detailed visualization:
• Note: For Left, “1” is the existing employees and “0” are employees that have left.
7
Methodology for solving employee attrition case by Daniel Ita Essien
Data Visualization
8
Methodology for solving employee attrition case by Daniel Ita Essien
Data Visualization
• The following can be deduced from all the plots:
• The number of Employees left is only 23% of the total
Employees.
• Most of the Employees are being paid low or medium salaries.
• Most of the Employees are doing 3 to 5 projects.
• A very less number of Employees have been promoted in the past
5 years.
• The sales department has more employees followed by technical
and support.
• Employees that have done majority of the projects have left the
company therefore leaving the not so experienced employees.
• The Employees that did 7 projects left the company probably
because they overworked.
Summary:
• Employees are more likely to leave the company if they have
not received promotion in the last 5 years.
• The 3rd year of work is very crucial because most employees left
during their 3rd year at work. Probably something employees
motivation could be raised more during their 3rd year.
• Most employees quit because of low or medium salary.
Something should be d0ne about this too.
9
Methodology for solving employee attrition case by Daniel Ita Essien
Cluster Analysis
• To find out the employees who left, we will make use of two main factors; satisfaction and performance at
work. This is plotted with a library “Scikit-learn”, a machine learning library. And we will be making use of
clustering.
• Note: Scikit-learn has to be installed in project interpreter in pycharm and imported thus at the beginning
of the codes:
from sklearn.cluster import Kmeans
# Filter data
left_emp = all_Employees[['satisfaction_level', 'last_evaluation']][all_Employees.left == 0]
# Create groups using K-means clustering.
kmeans = KMeans(n_clusters = 3, random_state = 0).fit(left_emp)
# Add new column "label" and assign cluster labels.
left_emp['label'] = kmeans.labels_
# Draw scatter plot
plt.scatter(left_emp['satisfaction_level'], left_emp['last_evaluation'], c=left_emp['label'],cmap='Accent')
plt.xlabel('Satisfaction Level')
plt.ylabel('Last Evaluation')
plt.title('3 Clusters of employees who left')
plt.show()
10
Methodology for solving employee attrition case by Daniel Ita Essien
Cluster Analysis
From the scatter plot, Employee who left the
company can be grouped into 3 types which are:
• High Satisfaction and High Evaluation(green dots)
• Low Satisfaction and High Evaluation(blue dots)
• Moderate Satisfaction and moderate Evaluation
(grey dots)
11
Methodology for solving employee attrition case by Daniel Ita Essien
Building Prediction Model
label = preprocessing.LabelEncoder()
all_Employees['salary']=label.fit_transform(all_Employees['salary'])
all_Employees['dept']=label.fit_transform(all_Employees['dept'])
# label encoder is used to transform salary and dept column to numeric columns
• To build the model, we will be using label encoding to map each value to a member, example
salary which has low, medium and high will have 0, 1 and 2 respectively. Label encoder has to be
imported at the beginning of the coding thus:
from sklearn import preprocessing
Training set and testing set
# import “from sklearn.model_selection import train_test_split” at the top of code
# Split dataset into training set and test set
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42) # 70% training and 30% test
# 70% data is used for training while 30% is used testing model
12
Methodology for solving employee attrition case by Daniel Ita Essien
Building Model
• Next, we will use GradientBoostingClassifier( ) function after importing its module as shown below to
create an object. We will use the fit( ) function to fit the model into the training dataset and pred( )
function to carry out prediction on the testing dataset.
# GradientBoostingClassifier is imported at the top of the code
GBC = GradientBoostingClassifier() # Creating Gradient Boosting Classifier
GBC.fit(X_train, y_train) # Training the model dataset
y_pred = GBC.predict(X_test) # Predicting the response for testing dataset
from sklearn.ensemble import GradientBoostingClassifier
13
Methodology for solving employee attrition case by Daniel Ita Essien
Evaluating Model Performance
# Metrics is imported from sklearn at the start of the coding
print("Accuracy:",metrics.accuracy_score(y_test, y_pred)) # Model Accuracy
print("Precision:",metrics.precision_score(y_test, y_pred)) # Model Precision
print("Recall:",metrics.recall_score(y_test, y_pred)) # Model Recall
C:Python27python.exe "C:/Users/Daniel Essien/PycharmProjects/Example1/Project.py"
('Accuracy:', 0.9771111111111112)
('Precision:', 0.9772856331629756)
('Recall:', 0.9933621933621933)
Process finished with exit code 0
• This prints out:
14
Methodology for solving employee attrition case by Daniel Ita Essien
Conclusion
• Evaluating the performance of the model as seen in the previous slide, it can be seen that we
got about 97% of accuracy which can be considered as good accuracy.
• We got a precision of about 97% too. Precision brings to light the correctness of a prediction
each time a model makes a one (a prediction). In this Employee Attrition Case, when the
Gradient Boosting Model predicts that an employee will leave, that employee will leave 97%
of the time.
• For recall, if there is an employee who left present in the testing dataset, the Gradient
Boosting Model can identify it 99% of the time.
15
Methodology for solving employee attrition case by Daniel Ita Essien

More Related Content

Similar to METHODOLOGY FOR SOLVING EMPLOYEE ATTRITION PROBLEM- Daniel Essien.pptx

Workshop: Your first machine learning project
Workshop: Your first machine learning projectWorkshop: Your first machine learning project
Workshop: Your first machine learning projectAlex Austin
 
IBM HR Analytics Employee Attrition & Performance
IBM HR Analytics Employee Attrition & PerformanceIBM HR Analytics Employee Attrition & Performance
IBM HR Analytics Employee Attrition & PerformanceShivangiKrishna
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Yeardezyneecole
 
Credit card fraud detection using python machine learning
Credit card fraud detection using python machine learningCredit card fraud detection using python machine learning
Credit card fraud detection using python machine learningSandeep Garg
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Omkar Rane
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Applicationdezyneecole
 
Comp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codeComp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codepradesigali1
 
Review the SHRM case Designing a Pay Structure” You will p.docx
Review the SHRM case Designing a Pay Structure” You will p.docxReview the SHRM case Designing a Pay Structure” You will p.docx
Review the SHRM case Designing a Pay Structure” You will p.docxfathwaitewalter
 
HR Analytics Project EEB
HR Analytics Project EEBHR Analytics Project EEB
HR Analytics Project EEBErik Bebernes
 
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxgilpinleeanna
 
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 Apurv Gupta, BCA ,Final year , Dezyne E'cole College Apurv Gupta, BCA ,Final year , Dezyne E'cole College
Apurv Gupta, BCA ,Final year , Dezyne E'cole Collegedezyneecole
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015dezyneecole
 
Identify Root Causes – C&E Matrix
Identify Root Causes – C&E MatrixIdentify Root Causes – C&E Matrix
Identify Root Causes – C&E MatrixMatt Hansen
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlpankit_ppt
 
Part I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docxPart I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docxherbertwilson5999
 
READ MEIf you need assistance using Excel, you can access a tutori.docx
READ MEIf you need assistance using Excel, you can access a tutori.docxREAD MEIf you need assistance using Excel, you can access a tutori.docx
READ MEIf you need assistance using Excel, you can access a tutori.docxmakdul
 
End to-end machine learning project for beginners
End to-end machine learning project for beginnersEnd to-end machine learning project for beginners
End to-end machine learning project for beginnersSharath Kumar
 

Similar to METHODOLOGY FOR SOLVING EMPLOYEE ATTRITION PROBLEM- Daniel Essien.pptx (20)

Workshop: Your first machine learning project
Workshop: Your first machine learning projectWorkshop: Your first machine learning project
Workshop: Your first machine learning project
 
IBM HR Analytics Employee Attrition & Performance
IBM HR Analytics Employee Attrition & PerformanceIBM HR Analytics Employee Attrition & Performance
IBM HR Analytics Employee Attrition & Performance
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Year
 
Credit card fraud detection using python machine learning
Credit card fraud detection using python machine learningCredit card fraud detection using python machine learning
Credit card fraud detection using python machine learning
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Application
 
Comp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codeComp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source code
 
Review the SHRM case Designing a Pay Structure” You will p.docx
Review the SHRM case Designing a Pay Structure” You will p.docxReview the SHRM case Designing a Pay Structure” You will p.docx
Review the SHRM case Designing a Pay Structure” You will p.docx
 
Vaibhavi Hiring Project.pdf
Vaibhavi Hiring Project.pdfVaibhavi Hiring Project.pdf
Vaibhavi Hiring Project.pdf
 
Hiring Process Analytics.pptx
Hiring Process Analytics.pptxHiring Process Analytics.pptx
Hiring Process Analytics.pptx
 
HR Analytics Project EEB
HR Analytics Project EEBHR Analytics Project EEB
HR Analytics Project EEB
 
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
 
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 Apurv Gupta, BCA ,Final year , Dezyne E'cole College Apurv Gupta, BCA ,Final year , Dezyne E'cole College
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015
 
Identify Root Causes – C&E Matrix
Identify Root Causes – C&E MatrixIdentify Root Causes – C&E Matrix
Identify Root Causes – C&E Matrix
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlp
 
Part I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docxPart I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docx
 
READ MEIf you need assistance using Excel, you can access a tutori.docx
READ MEIf you need assistance using Excel, you can access a tutori.docxREAD MEIf you need assistance using Excel, you can access a tutori.docx
READ MEIf you need assistance using Excel, you can access a tutori.docx
 
End to-end machine learning project for beginners
End to-end machine learning project for beginnersEnd to-end machine learning project for beginners
End to-end machine learning project for beginners
 
CSL0777-L07.pptx
CSL0777-L07.pptxCSL0777-L07.pptx
CSL0777-L07.pptx
 

Recently uploaded

Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineBruce Bennett
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceSanjay Bokadia
 
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.GabrielaMiletti
 
TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...
TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...
TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...rightmanforbloodline
 
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)Delhi Call girls
 
Joshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxJoshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxsportsworldproductio
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...poojakaurpk09
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkSujalTamhane
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...Pooja Nehwal
 
Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..Masuk Ahmed
 
0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf
0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf
0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdfssuserded2d4
 
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Standkumarajju5765
 
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理cowagem
 
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big BoodyDubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boodykojalkojal131
 

Recently uploaded (20)

Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector Experience
 
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.
 
TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...
TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...
TEST BANK For An Introduction to Brain and Behavior, 7th Edition by Bryan Kol...
 
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
 
Joshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxJoshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptx
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
Virgin Call Girls Delhi Service-oriented sexy call girls ☞ 9899900591 ☜ Rita ...
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmk
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Sa...
 
Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..Presentation on Workplace Politics.ppt..
Presentation on Workplace Politics.ppt..
 
0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf
0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf
0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf0425-GDSC-TMU.pdf
 
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
 
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Deccan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理OSU毕业证留学文凭,制做办理
OSU毕业证留学文凭,制做办理
 
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
 
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Ex 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big BoodyDubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
Dubai Call Girls Demons O525547819 Call Girls IN DUbai Natural Big Boody
 

METHODOLOGY FOR SOLVING EMPLOYEE ATTRITION PROBLEM- Daniel Essien.pptx

  • 1. METHODOLOGY FOR SOLVING EMPLOYEE ATTRITION PROBLEM BY DANIEL ITA ESSIEN Proof of Concept Project Hash-Analytic-Python-Analytics-Problem-case-study
  • 2. Methodology For Solving the Employee Attrition Problem • To solve the Employee attrition problem, lets consider what Employee attrition means. • According to Chiradeep, a HR Technologist, “Employee attrition occurs is defined as the natural process by which employees leave the workforce – for example, through resignation for personal reasons or retirement – and are not immediately replaced.” Data Loading Data Analysis and Visualization Cluster Analysis Building Predication Model Evaluating Model Performance Conclusion Methodology for solving employee attrition case by Daniel Ita Essien 2
  • 3. Data Loading • To make data visualization easy, a new column “left” with values “1” was added to the Existing Customers Sheet, and the same column was added to Employees who have left with values “0”. • The “‘display.max_columns’, None” and “‘display.width’, None” argument makes display of all columns in a DataFrame possible when printing. • First importation of modules that will be needed. #importing libraries import pandas as pd import matplotlib.pyplot as plt import seaborn as sns pd.set_option('display.max_columns', None) pd.set_option('display.width', None) 3 Methodology for solving employee attrition case by Daniel Ita Essien
  • 4. Data Loading excelfile = pd.ExcelFile("Problem case Study1.xlsx") #reading of excel file dframe = excelfile.parse("Existing employees") #specifies the sheet dframe2 = excelfile.parse("Employees who have left") #specifies the sheet both_sheets = [dframe, dframe2] #Takes in both sheets NewSheet = pd.concat(both_sheets) #merges both sheets by concatenation #creation of new excel file with concatenated sheets maintaining the indexes combined = NewSheet.to_excel('combined.xlsx', index=False) • Operations involving loading data from excel sheet is explained below in the comments with the codes. • After creation of new excel sheet “combined.xlsx”, the values of the default index in the sheet which is “Emp Id” was changed to a sequential numbers “1 – 14999” to aid visualization with Tableau Public, Community version 4 Methodology for solving employee attrition case by Daniel Ita Essien
  • 5. Data Analysis • The new excel sheet can be viewed thus: excelfile = pd.ExcelFile("combined.xlsx") all_Employees = excelfile.parse("Sheet1") print all_Employees <class 'pandas.core.frame.DataFrame'> RangeIndex: 14999 entries, 0 to 14998 Data columns (total 11 columns): Emp ID 14999 non-null int64 satisfaction_level 14999 non-null float64 last_evaluation 14999 non-null float64 number_project 14999 non-null int64 average_montly_hours 14999 non-null int64 time_spend_company 14999 non-null int64 Work_accident 14999 non-null int64 promotion_last_5years 14999 non-null int64 dept 14999 non-null object salary 14999 non-null object left 14999 non-null int64 dtypes: float64(2), int64(7), object(2) memory usage: 1.3+ MB • To know more about the loaded dataset: all_Employees.info() • Prints out the data by the right which is self explanatory 5 Methodology for solving employee attrition case by Daniel Ita Essien
  • 6. Data Analysis • The code below prints out the mean value of all Employee attributes using the groupby( ) function to specify Employees that left and those staying. left = all_Employees.groupby('left') print "Employees that left have the value of 0" print "Existing Employees have the value of 1" print "***************************************" print "Mean values for all Employee attributes" print left.mean() • Prints out: • With the above, you can notice that Employees who left had low satisfaction level, low promotion rate, spent more time, carried out more projects compared to those that stayed. 6 Methodology for solving employee attrition case by Daniel Ita Essien
  • 7. Data Visualization • The following plots were visualized using Tableau Public Community Edition so has to have a more detailed visualization: • Note: For Left, “1” is the existing employees and “0” are employees that have left. 7 Methodology for solving employee attrition case by Daniel Ita Essien
  • 8. Data Visualization 8 Methodology for solving employee attrition case by Daniel Ita Essien
  • 9. Data Visualization • The following can be deduced from all the plots: • The number of Employees left is only 23% of the total Employees. • Most of the Employees are being paid low or medium salaries. • Most of the Employees are doing 3 to 5 projects. • A very less number of Employees have been promoted in the past 5 years. • The sales department has more employees followed by technical and support. • Employees that have done majority of the projects have left the company therefore leaving the not so experienced employees. • The Employees that did 7 projects left the company probably because they overworked. Summary: • Employees are more likely to leave the company if they have not received promotion in the last 5 years. • The 3rd year of work is very crucial because most employees left during their 3rd year at work. Probably something employees motivation could be raised more during their 3rd year. • Most employees quit because of low or medium salary. Something should be d0ne about this too. 9 Methodology for solving employee attrition case by Daniel Ita Essien
  • 10. Cluster Analysis • To find out the employees who left, we will make use of two main factors; satisfaction and performance at work. This is plotted with a library “Scikit-learn”, a machine learning library. And we will be making use of clustering. • Note: Scikit-learn has to be installed in project interpreter in pycharm and imported thus at the beginning of the codes: from sklearn.cluster import Kmeans # Filter data left_emp = all_Employees[['satisfaction_level', 'last_evaluation']][all_Employees.left == 0] # Create groups using K-means clustering. kmeans = KMeans(n_clusters = 3, random_state = 0).fit(left_emp) # Add new column "label" and assign cluster labels. left_emp['label'] = kmeans.labels_ # Draw scatter plot plt.scatter(left_emp['satisfaction_level'], left_emp['last_evaluation'], c=left_emp['label'],cmap='Accent') plt.xlabel('Satisfaction Level') plt.ylabel('Last Evaluation') plt.title('3 Clusters of employees who left') plt.show() 10 Methodology for solving employee attrition case by Daniel Ita Essien
  • 11. Cluster Analysis From the scatter plot, Employee who left the company can be grouped into 3 types which are: • High Satisfaction and High Evaluation(green dots) • Low Satisfaction and High Evaluation(blue dots) • Moderate Satisfaction and moderate Evaluation (grey dots) 11 Methodology for solving employee attrition case by Daniel Ita Essien
  • 12. Building Prediction Model label = preprocessing.LabelEncoder() all_Employees['salary']=label.fit_transform(all_Employees['salary']) all_Employees['dept']=label.fit_transform(all_Employees['dept']) # label encoder is used to transform salary and dept column to numeric columns • To build the model, we will be using label encoding to map each value to a member, example salary which has low, medium and high will have 0, 1 and 2 respectively. Label encoder has to be imported at the beginning of the coding thus: from sklearn import preprocessing Training set and testing set # import “from sklearn.model_selection import train_test_split” at the top of code # Split dataset into training set and test set X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42) # 70% training and 30% test # 70% data is used for training while 30% is used testing model 12 Methodology for solving employee attrition case by Daniel Ita Essien
  • 13. Building Model • Next, we will use GradientBoostingClassifier( ) function after importing its module as shown below to create an object. We will use the fit( ) function to fit the model into the training dataset and pred( ) function to carry out prediction on the testing dataset. # GradientBoostingClassifier is imported at the top of the code GBC = GradientBoostingClassifier() # Creating Gradient Boosting Classifier GBC.fit(X_train, y_train) # Training the model dataset y_pred = GBC.predict(X_test) # Predicting the response for testing dataset from sklearn.ensemble import GradientBoostingClassifier 13 Methodology for solving employee attrition case by Daniel Ita Essien
  • 14. Evaluating Model Performance # Metrics is imported from sklearn at the start of the coding print("Accuracy:",metrics.accuracy_score(y_test, y_pred)) # Model Accuracy print("Precision:",metrics.precision_score(y_test, y_pred)) # Model Precision print("Recall:",metrics.recall_score(y_test, y_pred)) # Model Recall C:Python27python.exe "C:/Users/Daniel Essien/PycharmProjects/Example1/Project.py" ('Accuracy:', 0.9771111111111112) ('Precision:', 0.9772856331629756) ('Recall:', 0.9933621933621933) Process finished with exit code 0 • This prints out: 14 Methodology for solving employee attrition case by Daniel Ita Essien
  • 15. Conclusion • Evaluating the performance of the model as seen in the previous slide, it can be seen that we got about 97% of accuracy which can be considered as good accuracy. • We got a precision of about 97% too. Precision brings to light the correctness of a prediction each time a model makes a one (a prediction). In this Employee Attrition Case, when the Gradient Boosting Model predicts that an employee will leave, that employee will leave 97% of the time. • For recall, if there is an employee who left present in the testing dataset, the Gradient Boosting Model can identify it 99% of the time. 15 Methodology for solving employee attrition case by Daniel Ita Essien