How kasyap0999/hr_analytics works
This is an end-to-end HR attrition analytics project: obtain and profile employee data, engineer features, train and evaluate classifiers, then produce risk predictions, explanations, group audits, and BI-ready exports. The interactive Streamlit path collects an employee profile, derives the training features, and scores it with the saved model. The graph preserves README capabilities, but detailed implementation beyond the supplied excerpts is represented at subsystem level; only evidenced relationships are connected.
Main entry points: pipeline.py Training pipeline · shap_analysis.py SHAP analysis · streamlit_app.py Streamlit dashboard · attrition_model.joblib Saved model
Components 22
Data preparation
- IBM HR dataset
data/HR_Employee_Attrition.csv - Dataset downloader
src/download_data.py - Data quality report
outputs/data_quality.csv
Modeling and evaluation
- Training pipeline
src/pipeline.py - Feature engineering
src/pipeline.py - Preprocessing
src/pipeline.py - Classifier training
src/pipeline.py - Model evaluation
src/pipeline.py - Threshold analysis
src/pipeline.py - Saved model
models/attrition_model.joblib - Cross-validation
src/pipeline.py - Classification and metrics
outputs/classification_report.txt
Model insights
- SHAP analysis
src/shap_analysis.py - SHAP importance
outputs/shap_importance.csv - Group performance audit
src/fairness_audit.py - Group audit results
outputs/group_audit.csv
Prediction and reporting
- Predictions export
outputs/predictions.csv - Power BI export
outputs/powerbi_employee_attrition.csv - Streamlit dashboard
app/streamlit_app.py - Employee profile form
app/streamlit_app.py - Risk scoring
app/streamlit_app.py
Other components
- HR analyst
Connections 25
- HR analyst → Dataset downloader: requests data
README.md - Dataset downloader → IBM HR dataset: downloads
src/download_data.py - IBM HR dataset → Training pipeline: loads data
src/pipeline.py - Training pipeline → Feature engineering: engineers features
src/pipeline.py - Training pipeline → Preprocessing: builds preprocessing
src/pipeline.py - Training pipeline → Classifier training: fits classifiers
src/pipeline.py - Training pipeline → Model evaluation: evaluates models
src/pipeline.py - Training pipeline → Cross-validation: cross-validates
src/pipeline.py - Training pipeline → Threshold analysis: analyzes thresholds
src/pipeline.py - Training pipeline → Saved model: saves selected model
src/pipeline.py - Training pipeline → Predictions export: writes predictions
- Training pipeline → Data quality report: writes quality report
src/pipeline.py - Training pipeline → Power BI export: exports BI data
- Training pipeline → Classification and metrics: writes metrics
src/pipeline.py - HR analyst → Streamlit dashboard: opens dashboard
README.md - Streamlit dashboard → Saved model: loads model
app/streamlit_app.py - Streamlit dashboard → Employee profile form: collects profile
app/streamlit_app.py - Streamlit dashboard → Risk scoring: scores profile
app/streamlit_app.py - Risk scoring → Saved model: predicts with
app/streamlit_app.py - SHAP analysis → Saved model: loads model
src/shap_analysis.py - SHAP analysis → IBM HR dataset: reads data
src/shap_analysis.py - SHAP analysis → Feature engineering: reuses engineering
src/shap_analysis.py - SHAP analysis → SHAP importance: writes importance
src/shap_analysis.py - Group performance audit → Predictions export: reads predictions
src/fairness_audit.py - Group performance audit → Group audit results: writes audit
src/fairness_audit.py