How aagmans/staywise_cc works
StayWise is a telecom churn-risk prediction product with a Python model-development workflow, a Flask prediction API, a browser-based customer assessment tool, and a separate interactive CLI. A customer enters profile data in the web form or CLI; the runtime preprocesses it, scores churn probability, applies a decision threshold, and presents risk guidance. The web tool also shows SHAP explanations and can generate a PDF report. README documents the modeling stages; sampled source confirms API loading, web requests, and explanation wiring, but not every training-stage file interaction.
Main entry points: app.py Flask prediction API · predict.js Web assessment · 01_data_inspection.py Data inspection · 03_data_cleaning.py Clean and engineer
Components 21
Model development
- Data inspection
01_data_inspection.py - Exploratory analysis
02_eda.py - Clean and engineer
03_data_cleaning.py - Train validation test
04_train_test_split.py - Feature preprocessing
05_preprocessing.py - Class imbalance
06_class_imbalance.py - Model comparison
07_model_comparison.py - Threshold tuning
08_logistic_threshold.py - Held-out evaluation
09_final_test_evaluation.py - Save model artifacts
10_save_model.py
Prediction runtime
- Flask prediction API
app.py - SHAP explanations
explain.py - CLI predictor
12_interactive_prediction.py
Customer experience
- Web assessment
frontend/predict.js - PDF risk report
frontend/predict.js - Product landing page
frontend/main.js
Other components
- Data scientist
- Telco dataset
data/Telco_customer_churn.xlsx - Cleaned data
data/telco_cleaned.csv - Model artifacts
models - Telecom user
Connections 24
- Data scientist → Data inspection: inspects
README.md - Telco dataset → Data inspection: examines
- Data inspection → Exploratory analysis: analyzes
README.md - Exploratory analysis → Clean and engineer: informs
README.md - Telco dataset → Clean and engineer: cleans
README.md - Clean and engineer → Cleaned data: produces
README.md - Cleaned data → Train validation test: partitions
README.md - Train validation test → Feature preprocessing: feeds
README.md - Feature preprocessing → Class imbalance: supports
README.md - Class imbalance → Model comparison: informs
README.md - Model comparison → Threshold tuning: selects model
README.md - Threshold tuning → Held-out evaluation: sets threshold
README.md - Held-out evaluation → Save model artifacts: validates
README.md - Save model artifacts → Model artifacts: writes
10_save_model.py - Telecom user → Web assessment: enters profile
README.md - Web assessment → Flask prediction API: posts prediction
frontend/predict.js - CLI predictor → Model artifacts: loads
- Flask prediction API → Model artifacts: loads
app.py - Flask prediction API → Cleaned data: reads background data
app.py - Flask prediction API → SHAP explanations: builds explainer
app.py - Flask prediction API → Web assessment: returns risk result
frontend/predict.js - Web assessment → PDF risk report: generates
frontend/predict.js - Telecom user → CLI predictor: provides details
README.md - Telecom user → Product landing page: views product