This repository contains the code for an interactive dashboard that predicts and visualizes customer churn for PowerCo, a major gas and electricity utility. The dashboard is built with Streamlit and Plotly and provides various insights including churn metrics, risk categorization, and revenue impact.
The dashboard is divided into several sections:
-
Churn and Revenue Metrics: Provides a summary of key metrics including the churn rate, retention rate, number of customers at risk, revenue at risk, and monthly revenue.
-
Customer Churn Risk: Interactive visualizations of churn risk for different categories.
-
Average Revenue and Churn Risk by Category: Further visualizations showing the average revenue by category and churn risk against different categories.
-
Preview of At-Risk Customers: Displays a table with the top 10 customers at risk, sorted by their probability of churn.
The dashboard uses data from a file named preds.parquet
located in a specific directory. This file should be a Parquet file containing the data needed for the dashboard, including predictions of customer churn.
Clone the repository and navigate to the project directory.
git clone https://github.com/<your-username>/powerco-customer-churn.git
cd powerco-customer-churn
If you don't have Poetry installed, you can install it by following the instructions on the official Poetry website.
Once you have Poetry, you can install the project dependencies:
poetry install
You can now run the dashboard using Streamlit:
poetry run streamlit run app.py
Open your web browser and visit http://localhost:8501 to view the dashboard.