The goal of this project is to predict employee attrition in a firm using machine learning. Early detection of potential attrition helps HR teams plan manpower requirements and improve employee retention strategies.
- Dataset: Contains employee records with demographic, job-related, and performance features.
- Samples: 1471
- Features: Attrition and 34 more features0
- Target:
1โ Employee will leave (attrition)0โ Employee will stay
- Data Preprocessing
- Handled categorical variables using Label Encoding
- Cleaned and prepared dataset for training
- Model Training
- Algorithm: RandomForestClassifier
- Performed train-test split to evaluate model performance
- Evaluation
- Accuracy
- Precision
- Recall
- F1-score
- Accuracy: ~87% on test set
- The Random Forest model showed strong predictive performance with good accuracy.
- Results demonstrate the usefulness of machine learning for HR decision support.
- Clone repository:
git clone https://github.com/your-username/Employee-Attrition-RF.git
cd Employee-Attrition-RF- Install dependencies:
pip install -r requirements.txt- Run Jupyter Notebook:
jupyter notebook Employee Attrition Prediction.ipynb- Apply GridSearchCV for hyperparameter tuning
- Use SMOTE or other balancing techniques for imbalanced data
- Try other classifiers (Logistic Regression, XGBoost) for comparison
- Build a Streamlit web app for interactive predictions
MIT License