Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Employee Attrition Predictor – Streamlit App

This interactive web app helps HR professionals and analysts predict whether an employee is at risk of leaving (attrition) based on their profile. The app uses a machine learning model trained with XGBoost and explained using SHAP (SHapley Additive Explanations).


🚀 Features

  • ✅ Predict employee attrition with a tuned XGBoost model
  • 🎯 Uses a custom probability threshold for realistic classification
  • 📊 Interactive SHAP explainability for transparent predictions
  • 🧮 Real-time risk scoring with adjustable profile inputs
  • 💡 Clean and simple UI built with Streamlit

🛠 How to Run Locally

  1. Clone this repo
git clone https://github.com/your-username/employee-attrition-app.git
cd employee-attrition-app
  1. Install dependencies
pip install -r requirements.txt
  1. Launch the app
streamlit run app.py

🌐 Live Demo

👉 Click to try the app


📁 File Structure

📦 employee-attrition-app/
├── app.py                      # Streamlit frontend
├── employee.py                 # Model training and export
├── xgb_employee_model.pkl      # Trained XGBoost model
├── final_model_features.pkl    # Feature names used by the model
├── final_default_values.pkl    # Default values used for prediction UI
├── dropdown_options.pkl        # Categorical dropdown values
├── requirements.txt            # Dependencies
└── README.md                   # You're reading this!

📊 Model Details

  • Algorithm: XGBoost Classifier
  • Tuning: RandomizedSearchCV with ROC AUC scoring
  • Handling Imbalance: scale_pos_weight
  • Explainability: SHAP TreeExplainer for bar/force plots

🤝 Contributors

👤 Amey Suresh Borkar
📧 amey.borkar01@gmail.com
🔗 LinkedIn | GitHub


📄 License

MIT License — use it, share it, build on it.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages