--- title: EmployeeAttritionClassification emoji: 🏢 colorFrom: indigo colorTo: blue sdk: docker app_port: 8501 tags: - streamlit pinned: false short_description: Employee Attrition Predictor using XGBoost. license: mit --- ## Overview This app predicts the **probability of employee attrition (Attrition = 1)** using a trained **XGBoost classifier**. The model was evaluated using **ROC-AUC** and achieved strong validation performance. ## Files in this repo Place these files in the **repo root (same folder as `app.py`)**: - `xgb_model.pkl` — trained XGBoost model - `feature_names.pkl` — list of training feature columns (order matters) - `threshold.pkl` — decision threshold (e.g., 0.35) ## How to use the app ### 1) Single prediction (form) - Enter numeric/ordinal feature values - Select one option for categorical groups (one-hot) - The app outputs: - `Attrition probability` - `Attrition prediction` using your saved threshold ### 2) Batch prediction (CSV upload) Upload a CSV that is already in the **same feature format** as your training data (after preprocessing and one-hot encoding). The app will align columns automatically using `feature_names.pkl`. ## Notes - Kaggle submissions typically require **probabilities**, not class labels. - If you want to change the decision threshold, update `threshold.pkl`. ## Local run ```bash pip install -r requirements.txt streamlit run app.py