How karunya-475/churn-prediction works
Purpose and entry point
This is a notebook-centric machine-learning analysis for predicting bank credit-card customer churn (Attrition_Flag). The primary executable artifact is Churn Prediction.ipynb; it reads and analyzes the local source dataset Churn Prediction.csv. There is no packaged service, CLI, deployment artifact, or automated pipeline in the repository.
Source data boundary
Churn Prediction.csv is the system-of-record input: 10,127 customer records with demographics, account characteristics, and transaction behavior. Its target is the categorical Attrition_Flag field, distinguishing retained from churned customers. Data ingestion, integrity validation, and downstream transformations are expected to occur within Churn Prediction.ipynb.
Inspection and exploratory-analysis stage
The notebook first validates schema, dimensions, missing values, and duplicates, then performs EDA across categorical and numerical features. This establishes distribution, class-balance, skewness, outlier, and target-association context before model training.
• Churn Prediction.ipynb
• Churn Prediction.csv
Feature preparation boundary
Raw customer fields must be converted into model-ready inputs: target encoding (Existing Customer/Attrited Customer), categorical encoding, and numerical standardization. The intended separation is between predictors and Attrition_Flag; scaling is specifically relevant to models such as logistic regression.
• Churn Prediction.ipynb
Classification-model stage
The notebook is intended to train and compare several supervised binary classifiers: logistic regression as baseline; decision tree and random forest; and boosting approaches such as XGBoost or gradient boosting. Model selection is based on comparative evaluation rather than a declared production champion.
• Churn Prediction.ipynb
Evaluation and decision flow
Prepared records flow from preprocessing into each classifier, producing churn predictions/scores evaluated with precision, recall, F1, and ROC-AUC. Recall is materially important because churn is expected to be the minority class and missed churners are costly. Findings identify transaction volume/value and engagement features as key churn signals.
• Churn Prediction.ipynb
Runtime and future integration
The current runtime is an interactive Jupyter notebook with a local CSV dependency and likely Python ML libraries (not dependency-pinned in the repository). No external APIs, databases, cloud infrastructure, or model registry are present. Planned—but not implemented—boundaries include scikit-learn pipeline automation, imbalance handling (SMOTE/undersampling), hyperparameter search, and serving through Flask/FastAPI with a Streamlit dashboard.
Main entry points: Churn Prediction.ipynb Model-ready inputs · Churn Prediction.csv Churn Prediction.csv
Components 13
Interactive notebook
All analysis, preparation, training, and evaluation run in one notebook.
- Churn Prediction.ipynb · Primary executable artifact.
Churn Prediction.ipynb - Ingestion & validation · Checks schema, dimensions, missing values, and duplicates.
Churn Prediction.ipynb - Exploratory analysis · Examines distributions, imbalance, outliers, and target associations.
Churn Prediction.ipynb - Feature preparation · Encodes target and categorical fields; standardizes numerical features.
Churn Prediction.ipynb - Model-ready inputs · Predictors separated from encoded Attrition_Flag.
Churn Prediction.ipynb - Comparative evaluation · Compares precision, recall, F1, and ROC-AUC; recall is important for missed churn.
Churn Prediction.ipynb - Churn signal findings · Highlights transaction volume, value, and engagement as key signals.
Churn Prediction.ipynb
Classifier comparison
- Logistic regression
Churn Prediction.ipynb - Decision tree
Churn Prediction.ipynb - Random forest
Churn Prediction.ipynb - Boosting models · XGBoost or gradient boosting comparison candidates.
Churn Prediction.ipynb - Churn predictions & scores
Churn Prediction.ipynb
Other components
- Churn Prediction.csv · System-of-record customer data with Attrition_Flag target.
Churn Prediction.csv
Connections 16
- Churn Prediction.csv → Churn Prediction.ipynb: read locally
- Churn Prediction.ipynb → Ingestion & validation: executes
- Ingestion & validation → Exploratory analysis: validated records
- Ingestion & validation → Feature preparation: validated fields
- Exploratory analysis → Feature preparation: informs preparation
- Feature preparation → Model-ready inputs: encoded and scaled
- Model-ready inputs → Logistic regression: train
- Model-ready inputs → Decision tree: train
- Model-ready inputs → Random forest: train
- Model-ready inputs → Boosting models: train
- Logistic regression → Churn predictions & scores: predict
- Decision tree → Churn predictions & scores: predict
- Random forest → Churn predictions & scores: predict
- Boosting models → Churn predictions & scores: predict
- Churn predictions & scores → Comparative evaluation: metrics
- Comparative evaluation → Churn signal findings: selects insights