0% found this document useful (0 votes)
14 views50 pages

Sample Report - Without System Design

The document presents a project report on an AI-Powered Employee Attrition Prediction and Analysis System, which utilizes advanced machine learning algorithms and Explainable AI techniques to predict employee turnover. The system aims to enhance prediction accuracy and provide actionable insights for HR professionals, achieving up to 92% accuracy with a hybrid ensemble model. Key features include real-time predictions, a dashboard for visualization, and targeted retention strategies to minimize employee turnover.

Uploaded by

ragul.2001007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views50 pages

Sample Report - Without System Design

The document presents a project report on an AI-Powered Employee Attrition Prediction and Analysis System, which utilizes advanced machine learning algorithms and Explainable AI techniques to predict employee turnover. The system aims to enhance prediction accuracy and provide actionable insights for HR professionals, achieving up to 92% accuracy with a hybrid ensemble model. Key features include real-time predictions, a dashboard for visualization, and targeted retention strategies to minimize employee turnover.

Uploaded by

ragul.2001007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

AI-POWERED EMPLOYEE ATTRITION


PREDICTION AND ANALYSIS SYSTEM: AN
ENSEMBLE LEARNING APPROACH WITH
EXPLAINABLE INSIGHTS
A PROJECT REPORT

Submitted by
MEENA S (310624104185)
NITISH R (310622104214)
in partial fulfilment for the award of the degree

of

BACHELOR OF ENGINEERING
IN

COMPUTER SCIENCE AND ENGINEERING

EASWARI ENGINEERING COLLEGE, RAMAPURAM


(AUTONOMOUS)

ANNA UNIVERSITY: CHENNAI 600 025


NOV-DEC 2025
2

BONAFIDE CERTIFICATE

Certified that this project report titled “CONSOLE BASED GREEN TIPS APP” is
the Bonafide work of “MEENA S (310624104185), NITISH R (310624104214)” who
carried out the project work under my supervision.

Dr. S Cloudin​ ​ ​ ​ [Link]

HEAD OF THE DEPARTMENT​ ​ SUPERVISOR ​ ​

Professor​ ​ Assistant Professor

Dept. of CSE​ ​ ​ ​ ​ ​ Dept. of CSE

Easwari Engineering College​​ ​ ​ ​ Easwari Engineering College

Ramapuram. Ramapuram.

Submitted for the project work examination held on …………………………. .

INTERNAL EXAMINER​ ​ ​ ​ EXTERNAL EXAMINER


3

ABSTRACT

Employee attrition poses a significant challenge to organizations, leading to increased

recruitment costs, knowledge loss, and reduced productivity. Traditional Human Resource

(HR) systems rely on static, rule-based models or basic machine learning techniques, which

are often unable to capture the complex and dynamic behavioural patterns of employees.

These limitations result in reduced accuracy, lack of real-time predictions, and minimal

actionable insights for retention strategies. To address these challenges, this project proposes

an AI-Powered Employee Attrition Prediction and Analysis System, which leverages

advanced machine learning algorithms and Explainable AI techniques. The system analyses

critical employee parameters such as job satisfaction, performance ratings, workload, salary

progression, and promotion history. A hybrid ensemble model combining Random Forest,

XGBoost, and Logistic Regression is employed to enhance prediction accuracy and stability,

achieving up to 92% accuracy with reduced false positives. Furthermore, the integration of

SHAP (SHapley Additive Explanations) ensures transparency, enabling HR professionals to

understand the reasoning behind predictions and build trust in the system. The proposed

framework incorporates a real-time prediction dashboard and an HR intervention module that

provides targeted retention strategies, such as role adjustments, training programs, or career

growth initiatives. This not only minimizes the risk of employee turnover but also transforms

predictive analytics into proactive decision-making support for HR teams.

ACKNOWLEDGEMENT
4

​ We thank the Almighty GOD for the abundant blessings showered on us. We extend

our deepest love and gratitude to our dear parents who built up our career and backed us up in
life.

We thank our management and our Principal Dr. P. Deiva Sundari for the
opportunities given to us for our career development.

​ We feel indebted to the Head of the Department Dr. S. Cloudin, Professor,


Department of Computer Science and Engineering, Easwari Engineering College, for all his
encouragement, which has sustained our labour and efforts.

​ We express our deepest gratitude to the internal guide D. Kavitha, Assistant


Professor, Department of Computer Science and Engineering, Easwari Engineering College,
for his valuable guidance, ideas and support.

We would like to thank all other faculty members of the Department of Computer
Science and Engineering for their help and advice throughout our life on this campus.

Finally, we are thankful to all our friends and all others who encouraged us and helped us in
doing this project.​ ​ ​ ​ ​
5

TABLE OF CONTENTS

CHAPTER NO.​ ​ ​ TITLE​ ​ ​ ​ PAGE No.

ABSTRACT ​ iii

ACKNOWLEDGEMENT iv

LIST OF TABLES​ ​ viii

LIST OF FIGURES ​ ix

LIST OF ABBREVIATIONS x

1. INTRODUCTION​ ​ ​ ​ ​ ​ 1

1.1 OVERVIEW​ ​ ​ ​ ​ ​ 1

​ ​ ​ ​ 1.1.1 CAUSES OF EMPLOYEE ATTRITION 1

​ ​ ​ ​ 1.1.2 EFFECTS OF EMPLOYEE ATTRITION 2

1.2 OBJECTIVE​ ​ ​ ​ ​ ​ 3

​ ​ ​ 1.3 CHALLENGES IN THE DOMIAN​ ​ ​ 3

1.4 MOTIVATION 4

1.5 ORGANIZATION OF REPORT 6

2. RELATED WORK​ ​ ​ ​ ​ ​ 7

2.1 LITERATURE REVIEW​ ​ ​ ​ ​ 7

2.2 EXISTING TECHNOLOGY 9

​ 2.3 INFERENCE OF LITERATURE REVIEW​ ​ 10

​ ​ ​ 2.4 EXTRACTION FROM LITERARTURE REVIEW​ 12

3. SYSTEM ANALYSIS​ ​ ​ ​ ​ 15

​ ​ ​ 3.1 PROBLEM DEFINITION​ ​ ​ ​ 15


6

CHAPTER NO.​ ​ ​ TITLE​ ​ ​ ​ PAGE No.

​ 3.2 PROPOSED SOLUTION​ ​ ​ ​ ​ 15

​ ​ ​ 3.3 SOFTWARE COMPONENTS​ ​ ​ ​ 16

3.4 HARDWARE COMPONENTS​ ​ ​ ​ 18

3.5 USE CASES ​ ​ ​ ​ ​ ​ 18

4. IMPLEMENTATION​ 32

5.1 EXPERIMENTAL SETUP 32

5.2 MODULE IMPLEMENTATION DETAILS 33

​ 5.2.1 Data Source Module 33

​ 5.2.2 Data Processing Module 35

​ 5.2.3 Model Training Module 37

​ 5.2.4 Explainability Module 38

​ 5.2.5 Visualization & Dashboard Module ​ ​ ​ 39

6.​​ CONCLUSION AND FUTURE ENHANCEMENTS 41

​ 6.1 CONCLUSION 41

6.2 FUTURE ENHANCE3MENTS


42

APPENDIX 1: SAMPLE CODE​ ​ ​ ​ 44

REFERENCES​ 49
7

LIST OF TABLES

TABLE NO. TITLE PAGE NO.

​ ​

2.1​ ​ ​ ​ Inference of Literature Review​ ​ 10

​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​
​​ ​
8

LIST OF FIGURES

FIGURE NO. TITLE PAGE NO.


​ ​
1.1​ Key Insights from Exit Interview 5

4.1 Overall System Architecture 22


4.2 Block Diagram for Data Source Module 25

4.3 ​ ​ Block Diagram for Data Processing Module ​ 26

4.4​ ​ Block Diagram for Model Training & Prediction Module 27

4.5 Block Diagram for Explainability Module 28

4.6 Block Diagram for Visualization & Reporting Module 29

4.7 Employee Attrition Prediction: Use Case Diagram 29

4.8 Employee Attrition Prediction: Class Diagram 30

4.9 Employee Attrition Prediction: Activity Diagram 30

4.10 Employee Attrition Prediction: Sequence Diagram 31


9
10

LIST OF ABBREVIATIONS

●​ HR – Human Resources
●​ AI – Artificial Intelligence
●​ XAI – Explainable Artificial Intelligence
●​ XGBoost – Extreme Gradient Boosting
●​ SHAP – SHapley Additive exPlanations
●​ ML – Machine Learning
●​ API – Application Programming Interface
●​ LIME – Local Interpretable Model-Agnostic Explanations
●​ RAM – Random Access Memory
●​ ERP – Enterprise Resource Planning
●​ HRMS – Human Resource Management System
1

CHAPTER 1

INTRODUCTION

1.1​OVERVIEW

Employee attrition refers to the gradual reduction in an organization’s workforce due


to employees leaving their jobs, either voluntarily or involuntarily, and not being immediately
replaced. It is a natural part of business operations but becomes a serious concern when the
rate of attrition is higher than the rate of hiring or workforce replenishment. High attrition
levels can negatively affect an organization’s productivity, profitability, and long-term
stability.

Attrition may occur for several reasons. Voluntary attrition happens when employees
resign for better opportunities, higher pay, career growth, or improved work-life balance.
Involuntary attrition occurs when the organization terminates employees due to performance
issues, restructuring, or downsizing. Other contributing factors include job dissatisfaction,
lack of career advancement, poor workplace culture, inadequate compensation, excessive
workload, and limited managerial support.

The consequences of employee attrition extend beyond just losing manpower.


Organizations often face higher recruitment and training costs, loss of skilled talent, and
decreased employee morale among the remaining staff. Knowledge gaps and reduced
operational efficiency also become common issues, especially in industries where specialized
skills are critical.

Managing attrition has therefore become a key responsibility of Human Resource


(HR) departments. Organizations increasingly rely on predictive analytics and employee
engagement strategies to identify employees at risk of leaving and to design effective
retention plans. By focusing on career development, fair compensation, recognition, and
work-life balance, companies aim to reduce turnover and build a stable, motivated workforce.

1.1.1 CAUSES OF EMPLOYEE ATTRITION


2

a) Inadequate Compensation: One of the primary reasons employees leave is


dissatisfaction with their salary, benefits, or incentives. When compensation does not match
skills, experience,

or market standards, employees often seek better opportunities elsewhere.

b) Lack of Career Growth and Development: Employees expect opportunities for


promotion, skill enhancement, and professional growth. A lack of career advancement
pathways or insufficient training programs often leads to attrition.

c) Poor Job Satisfaction: Monotonous tasks, absence of recognition, and lack of meaningful
work contribute to dissatisfaction, motivating employees to leave their roles.

d) Work-Life Imbalance: Excessive working hours, constant overtime, and high job stress
prevent employees from balancing personal and professional life, leading to voluntary exits.

e) Personal and External Factors: Relocation, higher education, health issues, or family
responsibilities also play a role in attrition, though these factors are often beyond
organizational control.

1.1.2 EFFECTS OF EMPLOYEE ATTRITION:

a) Increased Recruitment and Training Costs: Hiring new employees requires advertising,
interviewing, and onboarding expenses. Additionally, training new hires to match the skill
level of previous employees incurs further costs.

b) Loss of Skilled Talent and Knowledge: Experienced employees leaving the organization
take with them valuable expertise, technical knowledge, and client relationships, creating
knowledge gaps that are difficult to replace.

c) Customer Dissatisfaction: In service-oriented industries, attrition of skilled employees


may negatively impact customer experience, as new employees may lack the same level of
understanding and rapport.

d) Impact on Organizational Reputation: A high attrition rate can damage an


organization’s image in the job market, making it less attractive to potential talent and
increasing difficulty in hiring top performers.
3

e) Hidden Costs and Disruptions: Beyond direct expenses, attrition leads to hidden costs
such as lost opportunities, reduced innovation, and disruption in team dynamics, all of which
hinder long-term growth.

1.2​OBJECTIVE

The primary objective of this project is to develop an AI-powered employee attrition


prediction and analysis system that can help organizations identify employees at risk of
leaving and take proactive steps to retain them. To achieve this, the project focuses on
building a robust predictive framework that combines machine learning, ensemble learning,
explainable AI, and visualization.

The project aims to preprocess and analyse employee datasets through data cleaning,
feature extraction, and encoding techniques to ensure high-quality inputs for the predictive
models. Using this processed data, three machine learning models—Logistic Regression,
Random Forest, and XGBoost—are implemented and evaluated to forecast attrition
outcomes. To enhance accuracy and overcome the limitations of individual classifiers, a
hybrid ensemble model is introduced, leveraging the complementary strengths of different
algorithms to achieve better generalization and stability.

Another key objective of this project is to incorporate Explainable AI (XAI) using


SHAP, which provides transparent and interpretable insights into the factors contributing to
employee attrition. This ensures that HR professionals not only receive accurate predictions
but also understand the underlying reasons behind them. Finally, the project seeks to design
an interactive HR dashboard that visualizes prediction results, highlights high-risk
employees, and suggests actionable retention strategies. Through this, the system empowers
HR managers to make informed, data-driven decisions for workforce stability and employee
satisfaction.

1.3​CHALLENGES IN THE DOMIAN

a) Data Quality and Imbalance


4

Employee attrition datasets are often imbalanced, with a smaller proportion of employees
leaving compared to those who stay. This imbalance makes it difficult for machine learning
models to identify meaningful patterns in attrition cases. Moreover, missing values,
inconsistent records, and incomplete employee data add to the challenge of ensuring reliable
predictions.

b) Interpretability of Models

While advanced algorithms such as Random Forest and XGBoost provide high accuracy, they
function as black-box models with limited transparency. HR professionals often require clear
reasoning behind predictions to build trust and make informed decisions. Ensuring model
interpretability through Explainable AI techniques like SHAP is essential but still challenging
to present in a simplified way for non-technical users.

c) Dynamic Employee Behaviour

Employee attrition is not solely dependent on historical data. It is influenced by dynamic


factors such as job market opportunities, organizational culture shifts, and economic
conditions. Capturing these ever-changing patterns in real time remains a significant
challenge for predictive systems.

d) Visualization and Usability

Transforming complex predictive outputs into meaningful insights for HR managers requires
well-designed dashboards and visualization tools. Developing a user-friendly interface that
balances detail with clarity is often difficult but necessary for practical adoption in
organizations.

e) Ethical and Privacy Concerns

Employee data contains sensitive information, and handling it requires strict privacy
measures. In addition, biases in datasets or algorithms can lead to unfair or discriminatory
5

outcomes. Addressing fairness, transparency, and confidentiality is therefore a major


challenge in deploying AI-based HR analytics.

1.4​MOTIVATION

Employee attrition has become one of the most pressing challenges faced by modern
organizations. The loss of skilled employees not only increases recruitment and training costs
but also affects overall productivity, knowledge retention, and employee morale. In
competitive industries, where talent is regarded as a strategic asset, the ability to predict and
prevent attrition is crucial for maintaining workforce stability and organizational growth. This
growing concern motivated the selection of employee attrition prediction as the focus of this
project.

Traditional methods of analysing attrition rely heavily on statistical techniques and


HR observations, which are often insufficient to capture the complex behavioural and
organizational factors that drive employees to leave. The availability of large datasets and
advancements in Artificial Intelligence (AI) and Machine Learning (ML) provide an
opportunity to move beyond descriptive analysis toward predictive and prescriptive solutions.
This project was therefore motivated by the potential of AI-driven approaches to uncover
hidden patterns in employee data, improve prediction accuracy, and provide actionable
insights for retention planning.
6

Fig 1.1 Key Insights from Exit Interview

Another strong motivation behind this project is the integration of Explainable AI


(XAI) and visualization through dashboards. While predictive accuracy is important, HR
professionals require clarity and interpretability in order to trust the system’s
recommendations. By using SHAP for explainability and a dashboard for visualization, this
project bridges the gap between technical models and practical decision-making. Ultimately,
the motivation lies in contributing to smarter HR practices, enabling organizations to
proactively manage their workforce, reduce attrition risks, and build a more satisfied and
engaged workforce.

1.5​ORGANIZATION OF REPORT

This report is organized as follows: Chapter 1 provides an overview of the project,


including the background of employee attrition, the objectives, motivation, challenges in the
domain. Chapter 2 presents the related works in the field of employee attrition prediction,
highlighting existing research studies, tools, and techniques used to analyse and reduce
attrition. Chapter 3 discusses the system analysis, which defines the problem statement,
7

requirements specification, and the various software and hardware components used in the
project. Chapter 4 describes the system design, including the architecture of the proposed
system, workflow diagrams, and module-wise descriptions. Chapter 5 explains the system
implementation, detailing the machine learning models used such as Logistic Regression,
Random Forest, and XGBoost, along with the ensemble learning approach and integration of
SHAP explainability. Chapter 6 provides the conclusion of the project along with future work
that can be carried out to enhance the system further. Appendix 1 consists of the Python code
implementation for the models, preprocessing steps, and dashboard development.

CHAPTER 2

RELATED WORK

2.1 LITERATURE REVIEW

​ Employee attrition has been studied widely using different analytical and machine
learning approaches, with researchers focusing on both prediction accuracy and
interpretability. N. B. Yahia et al. [1] discussed the transition from big data to deep data in
people analytics and highlighted how richer employee attributes can significantly improve
attrition prediction. K. Sekaran et al. [2] emphasized the role of Explainable AI (XAI) in
workforce analytics, using SHAP values to interpret the hidden drivers of attrition and
stressing the importance of transparency in AI-based HR systems. Similarly, A. Habous et al.
8

[3] evaluated supervised learning algorithms such as logistic regression, support vector
machines, and decision trees, showing that while these methods provide baseline predictions,
they often underperform in imbalanced datasets.

Recent works have also explored boosting and ensemble approaches to achieve higher
predictive power. T. K. Rohan et al. [4] applied gradient boosting techniques to employee
datasets and reported improved accuracy compared to traditional classifiers. Rohit et al. [5]
further validated the potential of machine learning for attrition forecasting, but they noted that
model effectiveness strongly depends on robust preprocessing and balanced datasets. M.
Dabbagh et al. [6] extended this analysis by comparing ensemble methods with deep learning
models, concluding that ensembles often strike the best balance between interpretability and
performance. B. Tanmayi et al. [7] reinforced this conclusion by demonstrating that while
deep learning captures complex patterns, ensemble methods provide superior practicality and
generalization in HR analytics.

Beyond predictive accuracy, researchers have examined contributing factors and


actionable recommendations for retention. K. M. Mitravinda and S. Shetty [8] analysed job
satisfaction, environment, and managerial support as key determinants of attrition and
stressed the importance of combining quantitative prediction with HR policy interventions. S.
George et al. [9] also studied machine learning algorithms in attrition prediction and
highlighted the role of feature engineering in enhancing model performance. S. Polisetti et al.
[10] introduced a stacking ensemble combining Logistic Regression and Random Forest,
showing that hybrid approaches leverage both linear and nonlinear strengths, thus producing
more reliable results for HR decision-making.

Visualization and interpretability have been recognized as critical for real-world HR


adoption. M. John et al. [11] presented a visual framework for attrition analysis,
demonstrating how dashboards and interactive tools improve HR managers’ ability to
understand predictions. N. Darapaneni et al. [12] performed a detailed analysis of AI models
and stressed the importance of evaluation metrics such as precision, recall, and F1-score in
imbalanced HR datasets. T. A. Roshinta and S. Gábor [13] compared LIME and SHAP,
9

highlighting SHAP’s superiority in producing consistent, trustworthy explanations for


attrition predictions.

Other studies have focused on specific algorithms and practical limitations. R. Jain
and A. Nayyar [14] showed that XGBoost is highly effective for employee attrition tasks but
requires significant computational resources. N. Khalifa et al. [15] evaluated different
machine learning techniques and concluded that while predictive performance is improving,
challenges remain in terms of fairness, data quality, and deployment in real HR environments.

Overall, the literature suggests that while individual machine learning models provide
a foundation for attrition prediction, ensemble methods offer higher accuracy and stability.
However, accuracy alone is insufficient without explainability and visualization. Researchers
consistently highlight the need for transparent models and HR-friendly dashboards that can
translate predictions into actionable retention strategies. These insights form the basis for this
project, which integrates ensemble modelling with SHAP explainability and dashboard
visualization to address the identified gaps.

2.2 EXISTING TECHNOLOGY

Employee attrition prediction has become a crucial domain in human resource


management as organizations seek to retain talent, reduce recruitment costs, and improve
overall productivity. Traditionally, HR practices relied heavily on manual records and basic
statistical analysis to identify employees at risk of leaving, which often provided limited
accuracy and lacked predictive capability. With the rapid growth of big data, organizations
now collect large volumes of employee-related data, including demographic information,
performance metrics, attendance, engagement scores, job satisfaction, and compensation
details [1][3][5].

Modern approaches leverage machine learning (ML) algorithms to transform these


datasets into actionable insights. Commonly used supervised learning models, such as
Logistic Regression, Decision Trees, Random Forests, Gradient Boosting, and XGBoost,
10

have been widely applied to predict attrition with higher precision compared to traditional
statistical models [3][4][5][14]. These algorithms are capable of analyzing complex
relationships among multiple features, identifying patterns that indicate potential employee
turnover, and generating probabilistic predictions that help HR managers focus on high-risk
employees [2][8][9].

To further improve performance, many studies have employed ensemble learning


techniques, which combine multiple models to enhance predictive accuracy and robustness.
Techniques like stacking, bagging, and boosting have been shown to outperform individual
algorithms by leveraging their complementary strengths and reducing the risk of overfitting
[7][10][6]. For example, stacking models that combine Logistic Regression and Random
Forest have successfully improved attrition prediction by capturing both linear and non-linear
relationships in employee data [10].

In addition to predictive accuracy, the interpretability of models is increasingly


recognized as essential for practical HR applications. Explainable AI (XAI) methods such as
LIME and SHAP have been used to identify the key features contributing to attrition
predictions, enabling HR managers to understand model outputs and design targeted retention
strategies [2][13]. These techniques make the predictions more transparent, increase trust in
automated systems, and help decision-makers prioritize interventions for employees most
likely to leave.

Visualization and dashboard tools have also been integrated into attrition prediction
systems to present insights in a comprehensible manner. Interactive dashboards, heatmaps,
and feature importance plots allow HR teams to monitor attrition trends, identify critical
factors affecting employee satisfaction, and make data-driven decisions for workforce
planning [11]. These tools bridge the gap between technical machine learning models and
actionable HR strategies.
11

Recent research highlights the increasing role of deep learning approaches in attrition
prediction. Deep neural networks and other advanced architectures can capture complex,
nonlinear relationships within employee data, which traditional models may fail to detect
[7][6]. Combining deep learning with ML ensembles has shown promise in improving
prediction accuracy and providing organizations with more reliable insights.

Overall, the evolution of technology in employee attrition prediction reflects a shift


from manual and statistical methods to sophisticated AI-driven solutions that integrate
machine learning, deep learning, explainable AI, and data visualization. These advancements
enable organizations to proactively identify high-risk employees, implement effective
retention strategies, optimize workforce management, and ultimately maintain a productive
and engaged workforce [1][2][7][10][13][15].

2.3 INFERENCE OF LITERATURE REVIEW

Table 2.1 Inference of Literature Review

Title Contribution
From Big Data to Deep Data to Support Leveraged deep, contextualized employee
People Analytics for Employee Attrition data to improve attrition prediction accuracy
Prediction [1] and support proactive HR decision-making.
Used explainable AI techniques to identify
Interpreting the Factors of Employee and interpret key factors influencing
Attrition using Explainable AI [2] employee attrition, enhancing model
transparency and HR decision-making.
Predicting Employee Attrition using Applied supervised learning classification
Supervised Learning Classification models to predict employee attrition,
Models [3] demonstrating the effectiveness of machine
learning in identifying high-risk employees.
Implemented Gradient Boosting algorithms
Employee Attrition Using Gradient to predict employee attrition, improving
Boosting [4] prediction accuracy by capturing complex
patterns in employee data.
12

Developed machine learning-based models


Prediction of Employee Attrition [5] to predict employee attrition, enabling early
identification of employees at risk of
leaving.
Applied multiple machine learning
Application of Machine Learning algorithms to predict employee attrition,
Algorithms for Predicting Employee comparing their performance to identify the
Attrition [6] most effective models for HR
decision-making.
Conducted a comprehensive analysis of
Comprehensive Analysis of Employee employee attrition using machine learning,
Attrition Using Machine Learning, Deep deep learning, and ensemble methods to
Learning and Ensemble Methods [7] improve prediction accuracy and capture
complex patterns in workforce data.
Employee Attrition: Prediction, Analysis Predicted employee attrition, analysed key
of Contributory Factors and contributory factors, and provided
Recommendations for Employee recommendations for improving employee
Retention [8] retention strategies.
Utilized machine learning algorithms to
Predicting Employee Attrition Using predict employee attrition, identifying
Machine Learning Algorithms [9] high-risk employees and enabling proactive
HR interventions.
Stacking Models for Employee Attrition Implemented stacking models combining
Prediction: Leveraging Logistic Logistic Regression and Random Forest to
Regression and Random Forest [10] enhance employee attrition prediction
accuracy.
Analysed employee attrition using
Analyzing Employee Attrition: A Visual visualizations to provide clear insights into
Perspective [11] trends and patterns for informed HR
decision-making.
A Detailed Analysis of AI Models for Performed a detailed evaluation of various
Predicting Employee Attrition Risk [12] AI models to predict employee attrition risk
and identify the most effective approaches.
13

A Comparative Study of LIME and Compared LIME and SHAP techniques to


SHAP for Enhancing Trustworthiness enhance the trustworthiness and
and Efficiency in Explainable AI Systems interpretability of AI models in employee
[13] attrition prediction.
Predicting Employee Attrition using Applied the XGBoost machine learning
XGBoost Machine Learning Approach algorithm to predict employee attrition,
[14] achieving high accuracy in identifying
employees at risk of leaving.
Evaluated multiple machine learning
Evaluating Machine Learning Algorithms algorithms to detect employee attrition and
to Detect Employees' Attrition [15] determine the most effective models for
prediction.

2.4 EXTRACTION FROM LITERARTURE REVIEW

A review of existing literature on employee attrition prediction reveals a strong


emphasis on leveraging machine learning (ML) and deep learning techniques for accurate
identification of employees at risk of leaving. N. B. Yahia et al. [1] emphasized the transition
from big data to deep data, highlighting the importance of contextualized and high-quality
employee data to improve predictive performance. K. Sekaran et al. [2] demonstrated the use
of explainable AI (XAI) methods such as LIME and SHAP to interpret the key factors
influencing attrition, making models more transparent and actionable for HR managers.

Supervised learning algorithms have been widely applied across studies, including
Logistic Regression, Decision Trees, Random Forests, Gradient Boosting, and XGBoost. A.
Habous et al. [3] and R. Jain & A. Nayyar [14] showed that these models can effectively
predict attrition by analyzing employee demographics, job roles, tenure, and performance
metrics. Gradient Boosting methods were specifically highlighted by T. K. Rohan et al. [4]
for their ability to capture complex patterns and improve prediction accuracy. M. Dabbagh et
al. [6] and S. George et al. [9] compared multiple ML algorithms, demonstrating the benefits
of algorithm selection based on dataset characteristics for better HR insights.
14

Several studies focused on ensemble learning methods, combining multiple models to


achieve higher accuracy and robustness. B. Tanmayi et al. [7] and S. Polisetti et al. [10]
explored stacking and hybrid approaches, integrating Logistic Regression and Random
Forests to leverage both linear and nonlinear feature relationships. These ensemble methods
outperform single-model approaches and provide more reliable predictions for workforce
management.

Deep learning techniques were also explored to handle complex and large datasets. B.
Tanmayi et al. [7] highlighted their potential in capturing nonlinear dependencies and
improving predictive performance when combined with ML models. Additionally,
visualization-based analyses by M. John et al. [11] helped in presenting attrition trends
clearly, making it easier for HR professionals to interpret insights and take timely action.

Across the literature, several key contributory factors for employee attrition were
consistently identified, including age, tenure, job role, department, salary, performance
ratings, and employee engagement levels. K. M. Mitravinda & S. Shetty [8] and K. Sekaran
et al. [2] emphasized the importance of understanding these factors for designing effective
retention strategies.

Finally, studies such as N. Darapaneni et al. [12], T. A. Roshinta & S. Gábor [13], and
N. Khalifa et al. [15] investigated model evaluation and comparison, highlighting the
significance of accuracy, interpretability, and trustworthiness in practical HR applications.
Overall, the literature demonstrates that integrating ML, deep learning, ensemble techniques,
and explainable AI forms a comprehensive approach to predicting employee attrition,
enabling organizations to make proactive workforce management decisions and improve
retention outcomes.
15

CHAPTER 3

SYSTEM ANALYSIS

3.1 PROBLEM DEFINITION

​ Although machine learning and deep learning techniques have improved employee
attrition prediction, existing approaches face several limitations. Many models lack
interpretability, making it difficult for HR managers to understand the reasons behind
predictions and take informed action. Most studies rely heavily on structured employee data,
often neglecting unstructured sources such as feedback or survey responses, which could
16

provide valuable insights. Feature selection and engineering are sometimes inadequate,
leading to models with irrelevant or redundant variables that reduce efficiency and accuracy.
Additionally, powerful algorithms like ensemble and gradient boosting methods can suffer
from overfitting, limiting generalization to new data. Comparative analysis of different
algorithms is often insufficient, and most models operate on static datasets, lacking real-time
adaptability. Finally, few systems are integrated into interactive dashboards or HR tools,
restricting proactive decision-making. Addressing these gaps is essential for developing a
robust, interpretable, and actionable employee attrition prediction system that effectively
supports HR strategies and enhances retention.

3.2 PROPOSED SOLUTION

To address the limitations identified in existing approaches, this project proposes an


intelligent employee attrition prediction system that integrates machine learning, ensemble
methods, and explainable AI to provide accurate, interpretable, and actionable insights for
HR decision-making. The proposed solution consists of the following key components:

a) Data Integration and Preprocessing:

Both structured (e.g., age, tenure, department, performance ratings) and unstructured data
(e.g., employee feedback, survey responses) will be collected and pre-processed to handle
missing values, normalize features, and encode categorical variables, ensuring a
comprehensive and high-quality dataset for analysis.

b) Feature Selection and Engineering:

Relevant features will be systematically identified using statistical analysis and feature
importance techniques to enhance model efficiency and reduce redundancy, ensuring that
only impactful variables contribute to predictions.

c) Hybrid Predictive Modelling:

The system will employ a combination of machine learning models (Logistic Regression,
Random Forest, XGBoost) and ensemble techniques (stacking or boosting) to improve
predictive accuracy while mitigating overfitting issues.

d) Explainable AI Integration:
17

XAI methods such as SHAP will be applied to interpret model outputs, allowing HR
managers to understand which factors contribute most to attrition predictions and enabling
data-driven retention strategies.

e) Visualization and Dashboard:

Interactive dashboards will display attrition risk, key contributing factors, and trends,
providing actionable insights for HR managers to proactively address potential turnover and
implement targeted interventions.

f) Real-Time and Dynamic Prediction Capability:

The system will be designed to update predictions dynamically as new employee data
becomes available, allowing continuous monitoring of attrition risks and timely HR
interventions.

The proposed system aims to combine predictive accuracy, interpretability, and


usability, creating a comprehensive solution that enables organizations to proactively manage
workforce attrition, improve employee retention, and make informed HR decisions.

3.3 SOFTWARE COMPONENTS

The employee attrition prediction system is implemented using Python and leverages
a combination of specialized libraries and development environments tailored to each stage of
the project—from data preprocessing to model deployment and visualization.

1. Data Handling and Preprocessing

●​ Pandas: Used to load datasets, handle missing values, encode categorical features,
and perform data transformations necessary for model input.

●​ NumPy: Provides efficient numerical operations and array handling, supporting


feature scaling and mathematical transformations.

●​ Scikit-learn preprocessing modules: Includes StandardScaler, LabelEncoder, and


OneHotEncoder for normalizing, encoding, and preparing features for machine
learning models.

2. Machine Learning Modelling


18

●​ Logistic Regression: Serves as a baseline model for predicting attrition by modelling


linear relationships between employee features and attrition outcomes.

●​ Random Forest: Captures non-linear patterns and feature interactions to improve


prediction accuracy.

●​ XGBoost: Implements gradient boosting for robust prediction and better handling of
complex datasets, controlling overfitting with hyperparameters like learning rate and
max depth.

3. Ensemble Modelling

●​ Voting Classifier (Scikit-learn): Combines Logistic Regression, Random Forest and


XGBoost models to form an ensemble, improving overall predictive performance and
reducing individual model weaknesses.

4. Explainable AI (XAI)

●​ SHAP (SHapley Additive Explanations): Provides feature-level interpretability of


model predictions, explaining why certain employees are at risk and supporting HR
decisions.

5. Visualization and Dashboard

●​ Matplotlib & Seaborn: Generate static visualizations such as feature distributions,


correlation heatmaps, and model performance graphs.

●​ Plotly & Dash: Build interactive dashboards for HR managers to explore attrition
risk, feature importance, and actionable insights in real-time.

6. Development Environment

●​ Jupyter Notebook: Enables step-by-step experimentation, model training,


visualization, and documentation in a single environment.

7. Model Persistence and Utilities

●​ Joblib / Pickle: Save and load trained models and SHAP explainers for efficient reuse
in dashboards or real-time predictions.

●​ Scikit-learn Metrics: Functions like accuracy_score, precision_score, recall_score,


and confusion_matrix for evaluating model performance.
19

These software components collectively enable a complete workflow-from data


preprocessing and feature engineering, through predictive modelling and ensemble learning,
to explainable AI and interactive visualization-ensuring the system is accurate, interpretable,
and user-friendly for HR managers.

3.4 HARDWARE COMPONENTS

​ This project is a software-oriented system for predicting employee attrition using


machine learning, ensemble models, and explainable AI. It does not involve any specialized
hardware or embedded devices, and all computations are performed on a standard computer
or laptop with sufficient processing capability to handle the dataset and train the models
efficiently. Typical requirements include a system with at least 8 GB RAM, a modern
multi-core processor, and standard storage to accommodate datasets, libraries, and models.

3.5 USE CASES

i) Users of the System:

The primary users of the system are:

a) HR Managers: Identify employees at risk of leaving, understand key attrition factors, and
design retention strategies.

b) Team Leads / Department Heads: Monitor attrition trends within their teams and address
potential issues proactively.

c) Data Analysts / HR Analysts: Analyse employee data, evaluate model performance, and
generate actionable insights for HR decisions.

ii) Use Cases:

a) HR Managers – Monitor Overall Attrition Risk

Goal: Identify employees at high risk of leaving.

Description: HR managers access the system dashboard to view attrition predictions,


employee risk scores, and trend reports. They can prioritize interventions, such as retention
programs, performance incentives, or training, to reduce turnover.
20

b) Team Leads / Department Heads – Department-Specific Insights

Goal: Understand and mitigate attrition within their teams.

Description: Department heads view the system to identify employees in their team likely to
leave. They can address workload, career growth, or engagement issues proactively.

c) Data Analysts / HR Analysts – Generate Reports & Insights

Goal: Analyse patterns and factors driving attrition.

Description: Analysts use the system to generate visualizations, perform deeper analysis, and
identify key factors (job satisfaction, tenure, performance) affecting attrition. Reports are
shared with management for strategic decision-making.

d) HR Managers – Strategic Retention Planning

Goal: Reduce organizational attrition rate.

Description: HR managers combine predictions with historical data to design policies for
employee retention, promotions, or compensation adjustments.

e) Team Leads – Individual Employee Action

Goal: Prevent resignations within the team.

Description: Team leads can access risk scores and insights for each team member and take
proactive measures, like mentoring sessions or recognition programs.

iii) Usage Scenarios:

a) Proactive HR Intervention

User: HR Manager

Situation: Monthly report shows top 10 high-risk employees.

Action: HR schedules engagement sessions and recommends incentives.

Outcome: Employee retention improves; attrition reduces.

b) Department-Level Monitoring

User: Department Head

Situation: The system flags high attrition risk in a specific department.


21

Action: Department head adjusts workload distribution and discusses career progression with
team members.

Outcome: Reduced team-level attrition and improved morale.

c) Data-Driven Insights

User: HR Analyst

Situation: System highlights that low job satisfaction and high overtime drive attrition.

Action: Analyst prepares reports and shares recommendations with management.

Outcome: Policies like flexible hours and engagement programs are implemented.

d) Workforce Planning

User: HR Manager & Analyst

Situation: Predicted attrition spike in the next quarter.

Action: Recruitment planning and proactive hiring in critical roles.

Outcome: Smooth operations and minimal disruption due to attrition.

CHAPTER 4

IMPLEMENTATION

​ The implementation of the Employee Attrition Prediction project began with


downloading the HR Analytics dataset, which contained employee demographic, job-related,
and performance features along with the attrition label. The dataset was pre-processed to
remove missing values, handle categorical attributes through encoding, and normalize
selected numerical features. Feature extraction and selection techniques were applied to
identify the most relevant attributes influencing attrition, such as age, monthly income, job
satisfaction, overtime status, and years at company. The pre-processed dataset was then used
to train multiple machine learning models, including Logistic Regression, Random Forest,
and XGBoost. To further improve prediction accuracy and robustness, an ensemble model
was developed by combining the outputs of the individual models. For explainability, SHAP
22

(SHapley Additive exPlanations) was integrated to provide HR managers with clear insights
into why an employee was predicted to be at risk, highlighting key contributing factors and
suggesting possible retention strategies. Finally, the results were integrated into an interactive
dashboard that visualizes attrition risk at both individual and organizational levels, making it
easier for HR professionals and team leads to understand the predictions and take informed
decisions.

4.1 EXPERIMENTAL SETUP

The experimental setup for the Employee Attrition Prediction System was designed to
ensure a reliable environment for model training, evaluation, and deployment. The
experiments were carried out on a system with Intel i5 processor, 8GB RAM, and Windows
10 operating system, using Python 3.10 in the Jupyter Notebook environment. The
implementation utilized major libraries including Pandas and NumPy for data preprocessing,
Scikit-learn for Logistic Regression and Random Forest, XGBoost for gradient boosting, and
SHAP for explainable AI analysis.

The dataset was initially pre-processed by handling missing values, encoding


categorical variables, and scaling numerical attributes. After preprocessing, the dataset was
split into training (70%) and testing (30%) sets to evaluate model generalization. Feature
extraction was applied to select relevant predictors such as Age, Monthly Income, Job
Satisfaction, OverTime, and Years at Company. Logistic Regression, Random Forest, and
XGBoost models were trained independently, and their performances were evaluated using
metrics such as Accuracy, Precision, Recall, and F1-score. To further improve predictive
performance, an ensemble model combining the outputs of the three base models was
developed using a soft voting mechanism.

For interpretability, the SHAP library was integrated into the workflow to generate
feature importance values and employee-level explanations, which were later used to provide
actionable insights for HR managers. Finally, the outputs were connected to a dashboard built
using Plotly/Dash for interactive visualization of attrition trends, individual employee risk
scores, and recommended retention strategies.

4.2 MODULE IMPLEMENTATION DETAILS


23

​ This section details the step-by-step implementation of each of the five primary
modules.

4.2.1 Data Source Module

[Link] Algorithm Used

The Data Source Module is responsible for acquiring, validating, and integrating employee
data from multiple sources. The algorithm follows an Extract–Transform–Load (ETL)
approach:

Steps of the Algorithm:

1.​ Extract: Import employee datasets (CSV/Excel/Database dump).

2.​ Transform: Check for missing values, duplicates, and inconsistent formats; unify
categorical labels (e.g., “Sales” vs. “sales”).

3.​ Load: Store the cleaned dataset into a structured format (Pandas DataFrame / SQL
Table) for downstream modules.

[Link] Mathematical Implementation

The mathematical part here is limited to data validation and normalization.

●​ Handling missing values:

(5.1)

where X is the feature set, and X′ is the cleaned feature set.

●​ Normalization of numerical features:

(5.2)

where x is the original value, μ is the mean, and σ the standard deviation.

These transformations ensure that the data is consistent and ready for preprocessing.

[Link] Experimental Setup


24

The Data Source Module was tested in the following setup:

●​ Dataset: IBM HR Analytics Attrition Dataset (1,470 records, 35 attributes).

●​ Input Formats: CSV and Excel files.

●​ Environment: Jupyter Notebook (Python 3.10).

●​ System Configuration: Intel i5, 8 GB RAM, Windows 10.

●​ Libraries Used: Pandas for loading, Numpy for validation, SQLAlchemy (optional)
for database storage.

[Link] Functional Components of Coding

The Data Source Module coding consists of three main functions:

●​ Data Loading:

import pandas as pd

data = pd.read_csv("employee_attrition.csv")

●​ Data Validation:

print([Link]().sum()) # Check missing values

print([Link]().sum()) # Check duplicate rows

[Link]. Implementation Using Tools & Components

●​ Software Components:

o​ Python (Pandas, NumPy): For extraction and validation.

o​ Jupyter Notebook: For development and testing.

●​ Hardware Components:

o​ Standard laptop/desktop (i5, 8 GB RAM) was sufficient since the dataset size
was small.

o​ No additional hardware was required as the project is data-driven and not


IoT/embedded.

4.2.2 Data Processing Module


25

[Link] Algorithm Used

The Data Processing Module prepares the raw dataset for modelling. It follows a Data
Cleaning & Transformation pipeline:

1.​ Handle missing values and duplicates.

2.​ Encode categorical variables into numerical form (Label Encoding / One-Hot
Encoding).

3.​ Normalize or standardize numerical features.

4.​ Perform feature selection or dimensionality reduction if required.

5.​ Split the dataset into training and testing sets.

[Link] Mathematical Implementation

●​ Label Encoding:

(5.3)

where each category is mapped to a numeric label.

●​ Min-Max Normalization:

(5.4)

●​ Train-Test Split:​
If dataset D has N records:

(5.5)

[Link] Experimental Setup


26

●​ Training set: 70% of data, Testing set: 30%.

●​ Libraries: Scikit-learn preprocessing (LabelEncoder, StandardScaler), Pandas.

●​ Validation: Checked distribution of each feature after encoding and scaling.

[Link] Functional Components of Coding

from sklearn.model_selection import train_test_split

from [Link] import LabelEncoder, StandardScaler

# Encode target

le = LabelEncoder()

data['Attrition'] = le.fit_transform(data['Attrition'])

# Select features

X = data[['Age','MonthlyIncome','JobSatisfaction','OverTime','YearsAtCompany']]

y = data['Attrition']

# Normalize

scaler = StandardScaler()

X_scaled = scaler.fit_transform(X)

# Split data

X_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.3,


random_state=42)

[Link] Implementation Using Tools

●​ Software: Python, Pandas, Scikit-learn.

●​ Hardware: Standard laptop/desktop.

4.2.3 Model Training Module

[Link] Algorithm Used

Three models were trained:

●​ Logistic Regression (LR): Linear classifier for binary attrition prediction.


27

●​ Random Forest (RF): Ensemble of decision trees for robust performance.

●​ XGBoost: Gradient boosting algorithm for high accuracy.

●​ Ensemble Model: Combines outputs using soft voting to improve accuracy.

[Link] Mathematical Implementation

●​ Logistic Regression:

(5.6)

●​ Random Forest:

(5.7)

where hi​is the prediction of each decision tree.

●​ XGBoost :

(5.8)

●​ Soft Voting Ensemble:

(5.9)

[Link] Experimental Setup

●​ 3 models + 1 ensemble model trained.

●​ Evaluation metrics: Accuracy, Precision, Recall, F1-Score.


28

●​ Cross-validation used to avoid overfitting.

[Link] Functional Components of Coding

from sklearn.linear_model import LogisticRegression

from [Link] import RandomForestClassifier, VotingClassifier

import xgboost as xgb

# Define models

lr = LogisticRegression()

rf = RandomForestClassifier()

xgb_model = [Link]()

# Ensemble (soft voting)

ensemble = VotingClassifier(estimators=[('lr', lr), ('rf', rf), ('xgb', xgb_model)],

voting='soft')

# Train models

for model in [lr, rf, xgb_model, ensemble]:

[Link](X_train, y_train)

[Link] Implementation Using Tools

●​ Software: Python (Scikit-learn, XGBoost).

●​ Hardware: Standard laptop; GPU optional for XGBoost.

4.2.4 Explainability Module

[Link] Algorithm Used

SHAP (SHapley Additive exPlanations) is used for interpretability. It assigns a


contribution value to each feature for a given prediction.

[Link] Mathematical Implementation

SHAP values are based on Shapley values from game theory:


29

(5.10)

where ϕi​is the SHAP value for feature i.

[Link] Experimental Setup

●​ Library used: SHAP (pip install shap).

●​ Applied on Random Forest and XGBoost predictions.

●​ Visualized global (feature importance) and local (per-employee) explanations.

[Link] Functional Components of Coding

import shap

# Explain predictions

explainer = [Link](rf, X_train)

shap_values = explainer(X_test)

# Plot global importance

shap.summary_plot(shap_values, X_test)

[Link] Implementation Using Tools

●​ Software: Python, SHAP library, Matplotlib.

●​ Hardware: Standard laptop.

4.2.5 Visualization & Dashboard Module

[Link] Algorithm Used

●​ Dashboard built using Plotly/Dash (or Streamlit for simplicity).

●​ Interactive charts to show attrition trends, department-wise risk, and individual


employee risk scores.
30

[Link] Mathematical Implementation

No heavy math — relies on aggregation functions:

(5.11)

[Link] Experimental Setup

●​ Dashboard deployed in local environment.

●​ Components: pie charts, bar graphs, SHAP plots.

●​ Users: HR managers, department heads, analysts.

[Link] Functional Components of Coding

import streamlit as st

import [Link] as px

[Link]("Employee Attrition Dashboard")

# Pie chart

fig = [Link](data, names='Attrition')

st.plotly_chart(fig)

fig2 = [Link](data, x='Department', color='Attrition')

st.plotly_chart(fig2)

[Link] Implementation Using Tools

●​ Software: Python, Streamlit / Plotly Dash.

●​ Hardware: Standard laptop; can be hosted on cloud for real-world use.

CHAPTER 5
31

CONCLUSION AND FUTURE ENHANCEMENTS

5.1 CONCLUSION

​ The project aimed to develop an AI-powered employee attrition prediction and


analysis system that could assist organizations in identifying employees at risk of leaving and
implementing proactive retention measures. The work undertaken has successfully met this
objective through the systematic design and integration of multiple machine learning
techniques, ensemble modelling, explainable AI, and visualization.

The project began with the collection and preprocessing of employee datasets, where
tasks such as data cleaning, feature extraction, and encoding were carried out. This ensured
that the dataset was free from inconsistencies and ready for modeling. The preprocessing step
played a crucial role in enhancing the quality of inputs, thereby improving the reliability of
predictions.

Next, three machine learning models—Logistic Regression, Random Forest, and


XGBoost—were trained and evaluated to forecast employee attrition outcomes. Each model
demonstrated its strengths, but to overcome the limitations of individual classifiers, a hybrid
ensemble model was developed. This ensemble learning approach successfully improved the
overall accuracy, generalization, and stability of the predictions, making it a robust predictive
framework for practical HR applications.

A significant contribution of this project lies in the integration of Explainable AI


(XAI) through SHAP values. While predictive accuracy is essential, it is equally important
for HR professionals to understand why employees may leave. SHAP provided
interpretability by highlighting the most influential features contributing to attrition, thereby
empowering HR managers with actionable insights rather than black-box predictions.
32

Finally, the project concluded with the design of an interactive HR dashboard, which
presented the results in a clear and intuitive manner. The dashboard not only visualized
prediction outcomes but also identified high-risk employees and suggested actionable
retention strategies. This visualization layer added significant practical value by ensuring that
technical results were translated into meaningful insights for decision-makers.

Key Achievements of the Project:

●​ Successful preprocessing and feature engineering for high-quality model inputs.

●​ Implementation of three machine learning models (Logistic Regression, Random


Forest, XGBoost).

●​ Development of a hybrid ensemble model to improve overall prediction accuracy.

●​ Incorporation of Explainable AI (SHAP) to provide transparency and interpretability.

●​ Creation of an interactive HR dashboard to visualize predictions and suggest retention


strategies.

●​ Fulfilment of the primary objective: empowering HR managers with accurate,


interpretable, and actionable insights for workforce stability.

5.2 FUTURE ENHANCEMENTS

While the project successfully addressed its objectives, there remains significant scope for
extension and improvement. Some possible directions include:

a) Adoption of Advanced Models

●​ Incorporating deep learning architectures such as neural networks and recurrent


models can capture complex, non-linear relationships in large-scale HR data.
●​ Exploring time-series forecasting could help predict attrition trends over specific time
frames.

b) Integration with Real-Time HR Systems

●​ Connecting the model with enterprise HR software (e.g., SAP, Workday) would allow
real-time monitoring of employee behavior and trigger early interventions.
●​ Automated alerts could notify HR managers when an employee shows signs of high
attrition risk.
33

c) Enhancement of the Dashboard

●​ Adding what-if analysis tools where HR professionals can simulate different policies
(e.g., salary increase, role change, flexible work) to see the effect on attrition.
●​ Providing personalized recommendations for retention based on employee profiles.

d) Expansion of Data Sources

●​ Incorporating external datasets such as market trends, salary benchmarks, and


economic indicators to strengthen prediction robustness.
●​ Including qualitative factors like employee satisfaction surveys, performance reviews,
and engagement metrics.

e) Scalability and Deployment

●​ Deploying the system as a cloud-based solution for scalability and accessibility across
multiple branches of an organization.
●​ Building an API integration so the prediction system can be plugged into existing HR
workflows seamlessly.

APPENDIX I
34

IMPORTING NECESSARY LIBRARIES

import pandas as pd

import numpy as np

from sklearn.model_selection import train_test_split

from [Link] import OneHotEncoder, StandardScaler, LabelEncoder

from [Link] import ColumnTransformer

from [Link] import Pipeline

from sklearn.linear_model import LogisticRegression

from [Link] import RandomForestClassifier, VotingClassifier

from [Link] import accuracy_score, classification_report, confusion_matrix

import seaborn as sns

import [Link] as plt

from xgboost import XGBClassifier

DATA LOADING, PREPROCESSING AND NORMALISATION

df = pd.read_csv("/content/[Link]")

# Drop useless columns

drop_cols = ["EmployeeCount", "Over18", "StandardHours", "EmployeeNumber"]

df = [Link](columns=[c for c in drop_cols if c in [Link]])

# Features & Target

X = [Link]("Attrition", axis=1)

y = df["Attrition"]

# Encode target: Yes/No → 1/0

le = LabelEncoder()
35

y = le.fit_transform(y)

# Separate categorical & numeric

cat_cols = X.select_dtypes(include=["object"]).columns

num_cols = X.select_dtypes(exclude=["object"]).columns

# Preprocessor (OneHot for categorical, StandardScaler for numeric)

preprocessor = ColumnTransformer([

("num", StandardScaler(), num_cols),

("cat", OneHotEncoder(handle_unknown="ignore"), cat_cols)

])

DATA SPLITTING

X_train, X_test, y_train, y_test = train_test_split(

X, y, test_size=0.2, random_state=42, stratify=y

LOGISTIC REGRESSION TRAINING

log_reg = Pipeline(steps=[

("preprocessor", preprocessor),

("classifier", LogisticRegression(max_iter=2000, class_weight="balanced", C=0.7))

])

log_reg.fit(X_train, y_train)

RANDOM FOREST TRAINING

rf = Pipeline(steps=[
36

("preprocessor", preprocessor),

("classifier", RandomForestClassifier(

n_estimators=500,

max_depth=10,

class_weight="balanced",

random_state=42

))

])

[Link](X_train, y_train)

XGBOOST TRAINING

xgb = Pipeline(steps=[

("preprocessor", preprocessor),

("classifier", XGBClassifier(

n_estimators=500,

learning_rate=0.05,

max_depth=6,

subsample=0.8,

colsample_bytree=0.8,

scale_pos_weight=([Link](y_train)[0] / [Link](y_train)[1]),

eval_metric="logloss",

random_state=42

))

])
37

[Link](X_train, y_train)

ENSEMBLE MODEL TRAINING

ensemble = VotingClassifier(

estimators=[('lr', log_reg), ('xgb', xgb), ('rf', rf)],

voting='soft', # soft voting uses predicted probabilities

weights=[1, 2, 2] # Give more weight to XGB and RF

[Link](X_train, y_train)

i) SAMPLE PREDICTION 1:

CODE:

new_data1 = {'Age': 38, 'Department': 'HR', 'DistanceFromHome': 7, 'Education': 4,


'Gender':'Female', 'JobInvolvement':3, 'NumCompaniesWorked':4, 'OverTime':'Yes',
'TotalWorkingYears':12, 'PerformanceRating':4, 'YearsInCurrentRole':3,
'PercentSalaryHike':18, 'MonthlyRate':11000, 'RelationshipSatisfaction':3, 'DailyRate':850,
'HourlyRate':42, 'MaritalStatus':'Married', 'StockOptionLevel':1,
'BusinessTravel':'Travel_Rarely', 'WorkLifeBalance':3, 'TrainingTimesLastYear':3,
'JobSatisfaction':4, 'YearsAtCompany':8, 'YearsSinceLastPromotion':1, 'EducationField':'Life
Sciences', 'EnvironmentSatisfaction':3, 'JobLevel':2, 'YearsWithCurrManager':3,
'JobRole':'HR Specialist', 'MonthlyIncome':6000}

new_df1 = [Link]([new_data1])

prediction = [Link](new_df1)

if prediction[0]==1:

print('Left')

else:

print('Stay')
38

OUTPUT

Stay

ii) SAMPLE PREDICTION 2

CODE

new_data2 = {'Age': 41, 'Department': 'Sales', 'DistanceFromHome': 1, 'Education': 2,


'Gender':'Female', 'JobInvolvement':3, 'NumCompaniesWorked':8, 'OverTime':'Yes',
'TotalWorkingYears':8, 'PerformanceRating':3, 'YearsInCurrentRole':4,
'PercentSalaryHike':11, 'MonthlyRate':19479, 'RelationshipSatisfaction':1, 'DailyRate':1102,
'HourlyRate':94, 'MaritalStatus':'Single', 'StockOptionLevel':0,
'BusinessTravel':'Travel_Rarely', 'WorkLifeBalance':1, 'TrainingTimesLastYear':0,
'JobSatisfaction':4, 'YearsAtCompany':6, 'YearsSinceLastPromotion':0, 'EducationField':'Life
Sciences', 'EnvironmentSatisfaction':2, 'JobLevel':2, 'YearsWithCurrManager':5,
'JobRole':'Sales Executive', 'MonthlyIncome':5993}

new_df2 = [Link]([new_data2])

prediction = [Link](new_df2)

if prediction[0]==1:

print('Left')

else:

print('Stay')

OUTPUT

Left

REFERENCES
39

1.​ N. B. Yahia, J. Hlel and R. Colomo-Palacios, "From Big Data to Deep


Data to Support People Analytics for Employee Attrition Prediction," in
IEEE Access, vol. 9, pp. 60447-60458, 2021, doi:
10.1109/ACCESS.2021.3074559.
2.​ K. Sekaran and S. S, "Interpreting the Factors of Employee Attrition
using Explainable AI," 2022 International Conference on Decision Aid
Sciences and Applications (DASA), Chiangrai, Thailand, 2022, pp.
932-936, doi: 10.1109/DASA54658.2022.9765067.
3.​ A. Habous, E. H. Nfaoui and Y. Oubenaalla, "Predicting Employee
Attrition using Supervised Learning Classification Models," 2021 Fifth
International Conference On Intelligent Computing in Data Sciences
(ICDS), Fez, Morocco, 2021, pp. 1-5, doi:
10.1109/ICDS53782.2021.9626761.
4.​ T. K. Rohan, T. Padmakara and A. G, "Employee Attrition Using
Gradient Boosting," 2025 8th International Conference on Trends in
Electronics and Informatics (ICOEI), Tirunelveli, India, 2025, pp.
821-825, doi: 10.1109/ICOEI65986.2025.11012971.
5.​ Rohit, S. Rai, R. Sharma, P. Singh, V. K. Dwivedi and V. Mishra,
"Prediction of Employee Attrition," 2024 International Conference on
Control, Computing, Communication and Materials (ICCCCM),
Prayagraj, India, 2024, pp. 609-613, doi:
10.1109/ICCCCM61016.2024.11039877.
6.​ M. Dabbagh, K. Saleem, A. Al-Jumaily, M. Tahir and A. Amphawan,
"Application of Machine Learning Algorithms for Predicting Employee
Attrition," 2024 IEEE International Conference on Future Machine
Learning and Data Science (FMLDS), Sydney, Australia, 2024, pp.
21-26, doi: 10.1109/FMLDS63805.2024.00014.
7.​ B. Tanmayi, H. Rishab, N. N. Yadav, A. A. S and M. Venugopalan,
"Comprehensive Analysis of Employee Attrition Using Machine
Learning, Deep Learning and Ensemble Methods," 2025 International
Conference on Knowledge Engineering and Communication Systems
(ICKECS), Chickballapur, India, 2025, pp. 1-6, doi:
10.1109/ICKECS65700.2025.11034779.
8.​ K. M. Mitravinda and S. Shetty, "Employee Attrition: Prediction,
Analysis Of Contributory Factors And Recommendations For Employee
Retention," 2022 IEEE International Conference for Women in
40

Innovation, Technology & Entrepreneurship (ICWITE), Bangalore, India,


2022, pp. 1-6, doi: 10.1109/ICWITE57052.2022.10176235.
9.​ S. George, K. A. Lakshmi and K. T. Thomas, "Predicting Employee
Attrition Using Machine Learning Algorithms," 2022 4th International
Conference on Advances in Computing, Communication Control and
Networking (ICAC3N), Greater Noida, India, 2022, pp. 700-705, doi:
10.1109/ICAC3N56670.2022.10074131.
10.​S. Polisetti, M. Bhargavi, S. Chitneni, S. Eluri, N. Kattamuri and R. R,
"Stacking Models for Employee Attrition Prediction: Leveraging Logistic
Regression and Random Forest," 2024 8th International Conference on
I-SMAC (IoT in Social, Mobile, Analytics and Cloud) (I-SMAC),
Kirtipur, Nepal, 2024, pp. 863-867, doi:
10.1109/I-SMAC61858.2024.10714670.
11.​M. John, M. Alharbi, N. Bin Daham and S. Abu Theeb, "Analyzing
Employee Attrition: A Visual Perspective," 2024 Seventh International
Women in Data Science Conference at Prince Sultan University (WiDS
PSU), Riyadh, Saudi Arabia, 2024, pp. 28-31, doi:
10.1109/WiDS-PSU61003.2024.00020.
12.​N. Darapaneni et al., "A Detailed Analysis of AI Models for Predicting
Employee Attrition Risk," 2022 IEEE 10th Region 10 Humanitarian
Technology Conference (R10-HTC), Hyderabad, India, 2022, pp.
243-246, doi: 10.1109/R10-HTC54060.2022.9929893.
13.​T. A. Roshinta and S. Gábor, "A Comparative Study of LIME and SHAP
for Enhancing Trustworthiness and Efficiency in Explainable AI
Systems," 2024 IEEE International Conference on Computing (ICOCO),
Kuala Lumpur, Malaysia, 2024, pp. 134-139, doi:
10.1109/ICOCO62848.2024.10928183.
14.​R. Jain and A. Nayyar, "Predicting Employee Attrition using XGBoost
Machine Learning Approach," 2018 International Conference on System
Modeling & Advancement in Research Trends (SMART), Moradabad,
India, 2018, pp. 113-120, doi: 10.1109/SYSMART.2018.8746940.
N. Khalifa, M. Alnasheet and H. Kadhem, "Evaluating Machine Learning
Algorithms to Detect Employees' Attrition," 2022 3rd International
Conference on Artificial Intelligence, Robotics and Control (AIRC), Cairo,
Egypt, 2022, pp. 93-97, doi: 10.1109/AIRC56195.2022.9836981.

You might also like