How sad-jack/customer-churn-prediction works
This is a Telco customer-churn prediction project. Its main workflow loads and cleans the CSV, prepares features, compares classifiers, evaluates and selects a model, then saves an artifact for single-customer predictions in a Streamlit UI. A separate exploratory script summarizes the dataset. The source excerpts show the training and inference calls; generated model and report files are outputs, not present in the supplied tree.
Main entry points: train.py Model training orchestration · predict.py Prediction service · streamlit_app.py Customer profile UI · explore_dataset.py Dataset explorer
Components 18
Data exploration
- Telco churn CSV
datasets/Telco-Customer-Churn.csv - Dataset explorer
explore_dataset.py
Model training
- Project configuration
src/config.py - Load and clean data
src/data_loader.py - Feature and target split
src/data_loader.py - Feature preprocessing
src/preprocess.py - Training command
train_model.py - Model training orchestration
src/train.py - Classifier comparison
src/train.py - Metrics and reports
src/evaluate.py - Training reports
Prediction app
- Saved model artifact
- Customer profile UI
app/streamlit_app.py - Prediction service
src/predict.py - Input feature frame
src/predict.py - Risk classification
src/predict.py
Other components
- Project user
- App user
Connections 20
- Project user → Dataset explorer: inspects data
explore_dataset.py - Dataset explorer → Telco churn CSV: reads CSV
explore_dataset.py - Project user → Training command: starts training
README.md - Training command → Model training orchestration: calls main
train_model.py - Model training orchestration → Project configuration: uses settings
src/train.py - Project configuration → Telco churn CSV: locates CSV
src/config.py - Model training orchestration → Load and clean data: loads and cleans
src/train.py - Load and clean data → Feature and target split: splits features
src/data_loader.py - Model training orchestration → Feature preprocessing: builds preprocessing
src/train.py - Model training orchestration → Classifier comparison: fits candidates
src/train.py - Model training orchestration → Metrics and reports: evaluates candidates
src/train.py - Model training orchestration → Saved model artifact: saves best model
src/train.py - Model training orchestration → Training reports: writes reports
src/train.py - App user → Customer profile UI: enters profile
app/streamlit_app.py - Customer profile UI → Prediction service: requests prediction
app/streamlit_app.py - Customer profile UI → Saved model artifact: loads cached model
app/streamlit_app.py - Prediction service → Saved model artifact: loads artifact
src/predict.py - Prediction service → Input feature frame: builds input
src/predict.py - Prediction service → Risk classification: derives risk level
src/predict.py - Prediction service → Customer profile UI: returns result
app/streamlit_app.py