The code in this repository was generated with the assistance of AI. However, I have thoroughly reviewed and understand every line of the code. All analyses, models, and results presented in this project are fully understood and interpreted by me. This project demonstrates my ability to use AI-generated tools while maintaining full ownership and comprehension of the work.
This project analyzes employee attrition and identifies key factors that influence turnover using machine learning techniques. It includes comprehensive data analysis, insights into employee behavior, and actionable solutions for improving employee retention.
Here are some key visualizations and analysis results that highlight the most significant patterns related to employee attrition:
- Sales Representatives have the highest attrition rate, indicating that this group may require special attention to improve retention.
- Single employees have a significantly higher attrition rate compared to married employees.
- Employees who work Overtime have a higher attrition rate, suggesting the need to address work-life balance.
- Employees with lower monthly income tend to leave the company more frequently.
- Employees who have been with the company for fewer years are more likely to leave.
-
Sales Representatives are more likely to leave with an attrition rate of 40%.
-
Singles have a higher likelihood of leaving with an attrition rate of 25%.
-
Employees working Overtime are more likely to leave, with an attrition rate of 30%.
-
Employees who Travel Frequently for work have an attrition rate of 25%, indicating a higher likelihood of leaving.
-
Employees in the Sales and HR Departments are more likely to leave, with an attrition rate of 20%.
-
In the Education Field, employees with Human Resources and Technical Degree backgrounds are more likely to leave, with an attrition rate around 25%.
-
Males are more likely to leave with an attrition rate of 18%.
-
Entry-Level Employees are more likely to leave, with an attrition rate of 27%.
- They are Sales Representatives (Attrition rate: 40%).
- They are Single (Attrition rate: 25%).
- They work Overtime (Attrition rate: 30%).
- They Travel Frequently for work (Attrition rate: 25%).
- They work in the Sales or HR Departments (Attrition rate: 20%).
- They have an HR or Technical Degree (Attrition rate: 25%).
- They are Male (Attrition rate: 18%).
- They are Entry-Level Employees (Attrition rate: 27%).
- They are Middle-Aged.
- They have Low Income.
- They are New Employees (relatively new to the organization).
- They live near the office (commute distance seems less significant).
- They’ve received minimal training (only a couple of times).
- They’ve had small salary hikes (below 18%).
-
Provide Career Growth
- Offer training and career paths, especially for entry-level and middle-aged employees.
-
Improve Salary & Benefits
- Adjust salaries and offer bonuses or performance incentives, especially for Sales Representatives and employees with low income.
-
Enhance Work-Life Balance
- Provide flexible hours and remote work options, particularly for those working overtime.
-
Reduce Commute Time
- Offer transportation benefits or remote work for employees who live near the office.
-
Boost Employee Engagement
- Organize team-building and foster an inclusive culture, especially for single employees and those new to the company.
-
Offer Mentoring
- Create mentorship programs to support entry-level employees and reduce turnover.
-
Focus on Job Satisfaction
- Conduct surveys to understand employee satisfaction and make improvements based on feedback.
-
Tailored Benefits for Key Roles
- Offer special benefits for high-turnover roles like Sales and HR positions.
-
Support Education
- Provide education reimbursement for employees with HR or Technical degrees.
-
Promote Supportive Leadership
- Ensure good management and regular feedback, especially for newer or middle-management employees.
- Categorical variables were encoded using one-hot encoding.
- Numerical features were scaled using StandardScaler.
- SMOTE (Synthetic Minority Over-sampling Technique) was applied to balance the attrition classes.
- Split data into training and test sets using Stratified Split to maintain the distribution of the target variable.
- Evaluated multiple models including Random Forest, Logistic Regression, and KNN.
- Key metrics for evaluation included confusion matrix, classification report, and cross-validation.
In addition to the analysis, several machine learning models were built and evaluated to predict employee attrition:
- Random Forest Classifier
- Logistic Regression
- K-Nearest Neighbors (KNN)
These models were tested and evaluated based on:
The Random Forest Classifier performed the best in terms of accuracy and balance between precision and recall.
-
Clone the repository:
git clone https://github.com/yourusername/employee-attrition.git
-
Install dependencies:
pip install -r requirements.txt
-
Run the analysis:
jupyter notebook Employee_Attrition.ipynb
This project is licensed under the MIT License - see the LICENSE file for details.
By focusing on understanding the root causes of employee attrition, this project provides valuable insights and practical recommendations that can help companies reduce turnover and retain top talent. The combination of data analysis and machine learning models allows organizations to make informed decisions and take proactive steps in improving employee satisfaction and retention.
This is your README.md
file in markdown format. Feel free to copy and paste it into your project! Let me know if you need any more modifications.