customer-churn-analytics-dashboard: Customer Churn Analytics Platform: Turning a Churn Model Into a Decision System

A Streamlit app that predicts churn, explains model behavior, and translates telco data into business actions with domain-driven feature engineering and XAI.

8 min read • View on GitHub • More from KrishnaParekh1803

A retention analyst studies a mechanical cockpit of gauges, dials, and linked indicators. One window shows a customer profile, another shows model confidence, another a business risk meter, and thin threads connect feature labels to a single action lever. The image explains that this repo turns churn prediction into a decision system, not just a dashboard.
The app behaves less like a chart page and more like a retention cockpit, where prediction, explanation, and business framing sit side by side.
Key Takeaways

The real product is not churn prediction

Most churn apps answer one question: who might leave? This one tries to answer three at once. It predicts churn for an individual customer, frames the business risk in portfolio terms, and explains why the model is leaning that way.

That changes the shape of the product. Instead of a black box score, you get a retention cockpit that is meant to support action. For a PM or founder, that is the difference between a model demo and something a team could actually use.

A hedcut-style portrait based on Krishna Parekh's verified GitHub avatar. The portrait introduces the repo author as the builder behind the churn analytics platform and grounds the article in a real contributor identity.

Why this is a glass box, not a black box

The repo pairs two kinds of interpretability. SHAP provides global importance, while Logistic Regression gives directional coefficients that are easier to read as business signals. That combination matters because it gives the UI both a ranking of drivers and a simpler story about whether a feature pushes risk up or down.

The pipeline is not linear in the product sense. It branches into prediction and explanation, then recombines in the business layer.

Conventional churn toolThis repoWhy it matters
Shows churn probabilityShows churn probability plus explanation and business framingTeams can act on the result instead of just observing it
Feeds raw fields into a modelAdds engineered signals like CLV, EngagementScore, and ContractRiskScoreThe model learns from business judgment, not only raw dataset columns
Treats interpretability as a separate reportBuilds SHAP and coefficients into the app experienceTrust arrives inside the workflow, not after it
Feels like a notebook exportFeels like a productized Streamlit applicationThe interface is closer to something a stakeholder could actually use
Optimizes for prediction aloneOptimizes for prediction, trust, and actionabilityThat is the real gap between ML demos and decision systems
Often hides preprocessingKeeps preprocessing artifacts serialized and aligned with inferenceTraining and serving stay consistent

The smartest part is the feature engineering

The repo does not stop at the IBM Telco fields. It creates CLV, EngagementScore, and ContractRiskScore, which is the real tell that the author is encoding retention intuition into the model. That is a stronger move than simply tuning a classifier.

Why it works: churn is not just a pattern in the data. It is a business judgment about loyalty, value, and friction. A customer with high monthly charges, short tenure, and a risky contract type should not look the same to the model as a long-tenured customer with broad service adoption.

A close-up cross-section of a pipeline where raw telco fields enter a transformer gate and emerge as stamped feature tokens labeled CLV, EngagementScore, and ContractRiskScore. The tokens then split into two tracks, one for prediction and one for explanation, showing how business logic shapes the model before inference.
The distinctive technical move here is not the classifier. It is the feature layer that inserts domain knowledge before the model sees the data.

How the pipeline is wired

The app is built as a modular Streamlit project with a serialized preprocessing pipeline and saved models. The important part is not the file format. It is the discipline: training-time transformations are preserved and reused at inference, so the customer view in the app matches what the model actually expects.

Under the hood, a ColumnTransformer splits numeric and categorical features. Numeric inputs get scaled, categories get one-hot encoded, and the transformed output is passed into the model stack. That keeps the serving path aligned with the training path, which is exactly where many lightweight ML apps drift into inconsistency.

# Conceptual flow from the repo's architecture
numeric_features = ["tenure", "MonthlyCharges", "TotalCharges", "CLV", "EngagementScore"]
categorical_features = ["InternetService", "PaymentMethod", "Contract", "gender"]

preprocessor = ColumnTransformer([
    ("num", StandardScaler(), numeric_features),
    ("cat", OneHotEncoder(handle_unknown="ignore"), categorical_features),
])

X_transformed = preprocessor.fit_transform(X_train)
prediction = model.predict(X_transformed)

What a stakeholder sees versus what the model sees

This repo is really about translation. The stakeholder sees polished metrics, charts, and clear labels. The model sees encoded features, transformed vectors, and coefficient space. Streamlit and Plotly make the front end feel like SaaS, while the underlying stack stays lightweight and easy to reason about.

Stakeholder viewModel viewEffect
Business metrics and retention signalsScaled numeric features and one-hot encoded categoriesThe output reads like a business conversation
Clear labels such as Fiber Internet ServiceEncoded columns such as cat__InternetService_Fiber opticTechnical detail is hidden without being lost
KPI cards and plotsSerialized artifacts and feature vectorsThe UI feels friendly, the pipeline stays reproducible
Risk priorities for customersPredicted class and importance scoresTeams get a decision, not just a probability

What makes the repo feel production-minded

The project is still a prototype, but it has the bones of a real analytics product. The .devcontainer signals reproducibility. The saved artifacts signal a deliberate boundary between training and serving. The page split signals that the author is thinking in product modules, not notebook cells.

That matters because churn tooling is only useful when the workflow survives beyond experimentation. A retention team needs consistency, legibility, and a path to iteration. This repo already points in that direction, even without live infrastructure or authentication.

Prototype traitProduction-minded traitWhy it matters
Ad hoc notebooksSerialized model and preprocessing artifactsInference can stay stable over time
Single analysis screenSeparate pages for prediction, analytics, and intelligenceUsers can move from question to action
Manual environment setupDev container supportOnboarding gets simpler and less fragile
Raw model outputHuman-readable feature mappingTrust improves across non-technical users

The limits are also the roadmap

The next obvious steps are not mysterious. Live data, authentication, and a database-backed workflow would move this from a polished V1 into a system that can support real teams. Right now the repo proves the product thinking. The next version would prove the operating model.