This app helps organisations predict the likelihood of employee attrition based on key features such as job role, age, income, and more. Built using machine learning, this tool empowers HR teams to proactively identify employees at risk of leaving and take timely action to improve retention.
Employee attrition (turnover) is a significant challenge for HR departments. By predicting which employees are at risk of leaving, companies can focus on improving retention strategies, reducing recruitment costs, and maintaining a stable workforce. This application uses a Random Forest Classifier to predict attrition with high accuracy, based on historical employee data.
Predict Employee Attrition: Given various employee attributes, the app will predict the likelihood of an employee leaving.
Data Preprocessing: Handles missing data, categorical variables, and scales numerical features for optimal model performance.
Interactive Dashboard: Easily input employee data for real-time predictions with an intuitive user interface.
Model Explanation: Understand the model's prediction through feature importance and detailed feedback on why an employee might leave.
Streamlit: For the interactive web app interface.
Pandas & NumPy: Data manipulation and analysis.
Scikit-learn: Model training, evaluation, and scaling.
Matplotlib: Data visualisation for insights and model performance.
Random Forest Classifier: The ML model used for prediction.
Pickle: Model serialisation for easy deployment and reuse.
Upload Your Dataset: Start by uploading your company’s employee data. The app will automatically preprocess it (handle missing values, scale features, and encode categorical variables).
Model Training: The app uses a trained Random Forest model to predict whether an employee is likely to leave or stay.
Real-time Prediction: Input new employee data, and get predictions instantly.
Actionable Insights: View feature importance to identify factors driving employee attrition and make data-backed decisions.
To get started, clone the repository and install the necessary dependencies.
bash: git clone https://github.com/your-username/attrition-prediction-app.git cd attrition-prediction-app
bash:
python -m venv venv
source venv/bin/activate # On Windows use venv\Scripts\activate
bash: pip install -r requirements.txt Run the app:
bash: streamlit run app.py
-
Once the app is running, open your browser and go to http://localhost:8501 to interact with the app.
-
Upload your employee dataset or enter new employee data for predictions.
-
View predictions along with insights about the most important features driving employee attrition.
Contributions are welcome! Feel free to fork this repository, submit issues, or send pull requests. You can help by:
Fixing bugs.
Enhancing features (e.g., adding more predictive models or metrics).
Improving the documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
This Attrition Prediction App is designed to provide actionable insights into employee retention. By harnessing the power of machine learning, you can predict potential attrition risks and take proactive steps to retain top talent.