How syedmuhammadubaidurrehman22/customer_churn_prediction works
Customer Churn Analytics turns a Telco snapshot into validated MySQL tables, trains and registers an explicitly unapproved XGBoost benchmark, scores the snapshot, and analyzes business scenarios. The principal workflow is CSV ingestion → raw data → versioned labels and features → benchmark training → optional registration → explicit benchmark scoring → predictions and business validation. Training, scoring, and validation are distinct downstream capabilities, not one automatic pipeline. The README and excerpts support the main data flow; unsampled SQL and module internals are represented only where documented, with evidence limits reflected in the edges.
Main entry points: utils.py Database engine helper · business_validation.py Scenario analysis · train.py Train benchmark · score.py Benchmark scoring
Components 19
Ingestion
- Pipeline runner
run_pipeline.py - Validate and ingest
src/ingest.py
Snapshot data
- Raw customers
sql/01_create_tables.sql - Snapshot labels
src/labels.py - Label table
sql/02_create_labels.sql - Feature materializer
src/features.py - Feature table
sql/03_create_feature_store.sql
Benchmark modeling
- Train benchmark
src/train.py - Model artifacts
src/train.py - Model registry
sql/04_create_model_registry.sql - Register and load
src/registry.py
Scoring
- Benchmark scoring
src/score.py - Prediction table
sql/05_create_model_predictions.sql
Business validation
- Scenario analysis
src/business_validation.py - Validation records
sql/06_create_business_validation.sql
Shared infrastructure
- Stage configuration
src/config.py - Database engine helper
src/utils.py
Other components
- Telco CSV
data/raw/WA_Fn-UseC_-Telco-Customer-Churn.csv - MySQL
Connections 32
- Telco CSV → Validate and ingest: loads and validates
src/ingest.py - Pipeline runner → Validate and ingest: runs
run_pipeline.py - Pipeline runner → Snapshot labels: runs
run_pipeline.py - Pipeline runner → Feature materializer: runs
run_pipeline.py - Validate and ingest → Raw customers: replaces rows
src/ingest.py - Snapshot labels → Raw customers: reads outcome
README.md - Snapshot labels → Label table: materializes labels
src/labels.py - Feature materializer → Raw customers: reads attributes
src/features.py - Feature materializer → Feature table: materializes features
src/features.py - Train benchmark → Feature table: reads features
src/train.py - Train benchmark → Label table: reads labels
src/train.py - Train benchmark → Model artifacts: writes model and report
src/train.py - Train benchmark → Register and load: optionally registers
src/train.py - Register and load → Model artifacts: validates and loads
src/registry.py - Register and load → Model registry: registers metadata
src/registry.py - Benchmark scoring → Model registry: selects model
src/score.py - Benchmark scoring → Register and load: loads artifacts
src/score.py - Benchmark scoring → Feature table: reads snapshot
src/score.py - Benchmark scoring → Prediction table: writes scores
src/score.py - Scenario analysis → Model registry: reads model metadata
src/business_validation.py - Scenario analysis → Prediction table: reads benchmark scores
src/business_validation.py - Scenario analysis → Feature table: checks feature snapshot
src/business_validation.py - Scenario analysis → Label table: joins labels
src/business_validation.py - Scenario analysis → Validation records: optionally saves scenarios
src/business_validation.py - Validate and ingest → Database engine helper: gets engine
src/ingest.py - Snapshot labels → Database engine helper: gets engine
src/labels.py - Feature materializer → Database engine helper: gets engine
src/features.py - Train benchmark → Database engine helper: gets engine
src/train.py - Register and load → Database engine helper: gets engine
src/registry.py - Benchmark scoring → Database engine helper: gets engine
src/score.py - Scenario analysis → Database engine helper: gets engine
src/business_validation.py - Database engine helper → Stage configuration: reads connection settings
src/utils.py