Skip to content

sam0per/telecom_initiative_dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Telecom Initiative Performance Dashboard

A comprehensive, interactive analytics dashboard built with Streamlit for tracking and analyzing telecom initiative performance. Features advanced cohort analysis, survival modeling, and data visualization capabilities. DataPipelineVisualization


✨ Features

πŸ“ˆ Overview Dashboard

  • Real-time KPI tracking (Revenue Impact, Churn Rate, NPS)
  • Interactive time-series visualizations with Plotly
  • Performance metrics with delta indicators
  • Historical trend analysis

πŸ“Š Adoption & Engagement Analytics

  • User adoption rate tracking
  • Daily Active Users (DAU) and Monthly Active Users (MAU) monitoring
  • Engagement intensity metrics (DAU/MAU ratio)
  • Growth trend visualizations

🧬 Cohort Survival Analysis (New)

  • Kaplan-Meier survival curves for retention analysis
  • Multi-cohort comparison with statistical testing
  • Hazard ratio analysis using Cox Proportional Hazards model
  • Time-to-event analysis (churn prediction)
  • Comprehensive cohort segmentation:
    • User segments (Enterprise, SMB, Consumer)
    • Regional cohorts (North, South, East, West)
    • Plan types (Premium, Standard, Basic)
    • Seasonal cohorts (Quarterly signups)
  • Interactive visualizations with confidence intervals
  • Statistical comparison tools (log-rank tests, pairwise analysis)

πŸš€ Quick Start

Prerequisites

  • Python 3.11+ (recommended: 3.11 or 3.12)
  • uv package manager (recommended) or pip

Installation

Option 1: Using uv (Recommended)

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone https://github.com/sam0per/telecom_initiative_dashboard.git
cd telecom_initiative_dashboard

# Install dependencies
uv sync

Option 2: Using pip

# Clone the repository
git clone https://github.com/sam0per/telecom_initiative_dashboard.git
cd telecom_initiative_dashboard

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Running the Dashboard

# With uv
uv run streamlit run app.py

# With pip
streamlit run app.py

The dashboard will open automatically in your browser at http://localhost:8501


πŸ“‚ Project Structure

telecom_initiative_dashboard/
β”œβ”€β”€ app.py                          # Main Streamlit application
β”œβ”€β”€ data.py                         # Mock data generation functions
β”œβ”€β”€ requirements.txt                # pip dependencies
β”œβ”€β”€ pyproject.toml                  # uv/project configuration
β”‚
β”œβ”€β”€ module/                         # Page modules
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ overview.py                 # Overview dashboard page
β”‚   β”œβ”€β”€ adoption.py                 # Adoption & engagement page
β”‚   └── cohort_analysis.py          # Cohort survival analysis page
β”‚
β”œβ”€β”€ utils/                          # Utility functions
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── cohort_builder.py           # Cohort definition & time-to-event calculations
β”‚
β”œβ”€β”€ doc/                            # Documentation
β”‚   └── healthcare_features_doc.md  # Feature development guide
β”‚
└── tests/                          # Unit tests (to be added)

πŸ“Š Dashboard Pages

1. 🏠 Overview

High-level summary of critical KPIs:

  • Revenue Impact: Estimated additional revenue (M$)
  • Churn Rate: Customer retention metrics (%)
  • Net Promoter Score (NPS): Customer satisfaction index

Features:

  • Current snapshot with period-over-period deltas
  • Time-series trend charts
  • Interactive hover details

2. πŸ“ˆ Adoption & Engagement

User adoption and engagement tracking:

  • Adoption Rate: % of target users actively using initiatives
  • DAU/MAU: Daily and monthly active user counts
  • Engagement Ratio: Stickiness indicator (DAU/MAU %)

Features:

  • Multi-metric trend visualization
  • Engagement intensity analysis
  • S-curve adoption modeling

3. 🧬 Cohort Analysis

Advanced survival analysis for user retention:

  • Kaplan-Meier Curves: Visual survival probability over time
  • Statistical Testing: Log-rank tests for cohort comparison
  • Hazard Ratios: Cox PH model for relative churn risk
  • Retention Metrics: 30/60/90/180-day retention rates

Features:

  • Multiple cohort selection (segments, regions, plans, seasons)
  • Interactive survival curve plots with confidence intervals
  • Pairwise cohort comparison matrix
  • Detailed statistical analysis
  • Export analysis results (CSV)

πŸ”§ Technical Details

Dependencies

Core Libraries:

  • streamlit >= 1.20.0 - Web application framework
  • pandas >= 1.4.0 - Data manipulation
  • plotly >= 5.10.0 - Interactive visualizations
  • numpy >= 1.20.0 - Numerical computing

Analytics Libraries:

  • lifelines >= 0.30.0 - Survival analysis (Kaplan-Meier, Cox PH)
  • scipy >= 1.16.3 - Statistical functions
  • scikit-learn >= 1.7.2 - Machine learning utilities

Data Generation:

  • faker >= 37.12.0 - Synthetic data generation

Development Tools:

  • pytest >= 8.4.2 - Testing framework
  • black >= 25.9.0 - Code formatting
  • flake8 >= 7.3.0 - Code linting

Data Caching

The dashboard uses @st.cache_data with a 10-minute TTL (Time To Live) for optimal performance:

  • Overview data: Cached for 600 seconds
  • Adoption data: Cached for 600 seconds
  • Cohort data: Cached for 600 seconds

Clear cache via Streamlit's UI menu: ☰ β†’ Clear cache


πŸ“ˆ Usage Examples

Running Cohort Analysis

  1. Navigate to 🧬 Cohort Analysis page
  2. Select cohorts from the sidebar (e.g., "User Segments")
  3. View survival curves and retention metrics
  4. Compare cohorts using statistical tests
  5. Export results for further analysis

Understanding Survival Curves

  • Y-axis: Probability of remaining active (0-100%)
  • X-axis: Days since user signup
  • Shaded areas: 95% confidence intervals
  • Higher curves: Better retention

Interpreting Hazard Ratios

  • HR = 1.0: Reference cohort (baseline risk)
  • HR > 1.0: Higher churn risk than reference
  • HR < 1.0: Lower churn risk (better retention)
  • Green bars: Statistically significant differences (p < 0.05)

πŸ§ͺ Testing the Utilities

Cohort Builder

# Test cohort builder functions
uv run python utils/cohort_builder.py

Expected output:

  • βœ… Loaded N users
  • βœ… Created cohort definitions
  • βœ… Assigned cohorts with boolean columns
  • βœ… Calculated survival data (duration, event_observed)
  • βœ… Generated cohort summary statistics

Cohort Analysis

# Test Kaplan-Meier analysis
uv run python module/cohort_analysis.py

Expected output:

  • βœ… Kaplan-Meier analysis for selected cohorts
  • βœ… Survival summary table
  • βœ… Log-rank test results
  • βœ… Hazard ratios (Cox PH)
  • βœ… Comparison matrix

πŸ› οΈ Development

Adding a New Page

  1. Create module file: module/new_page.py
  2. Implement display function:
    def display_page():
        st.title("New Page Title")
        # Your page logic here
  3. Register in app.py:
    from module import new_page
    
    PAGES = {
        # ...existing pages...
        "πŸ†• New Page": new_page.display_page,
    }

Code Formatting

# Format code with black
uv run black .

# Lint with flake8
uv run flake8 .

Running Tests

# Run all tests
uv run pytest tests/ -v

# Run with coverage
uv run pytest tests/ --cov=utils --cov=module

πŸ“š Key Metrics Glossary

Metric Description Interpretation
Adoption Rate % of target users actively using the initiative Higher = better feature uptake
DAU/MAU Ratio Daily active / Monthly active users Higher = more engaged users
NPS Net Promoter Score (-100 to +100) > 0 is good, > 50 is excellent
Churn Rate % of users who discontinue service Lower = better retention
Median Survival Time until 50% of cohort has churned Higher = better retention
Hazard Ratio Relative churn risk vs reference cohort < 1 = lower risk, > 1 = higher risk

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch:
    git checkout -b feature/your-feature-name
  3. Make your changes and commit:
    git commit -m "Add: brief description of changes"
  4. Push to your fork:
    git push origin feature/your-feature-name
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add docstrings to all functions
  • Include unit tests for new features
  • Update README for user-facing changes

πŸ“§ Support & Contact


πŸ“„ License

This project is open source and available under the MIT License.


🎯 Roadmap

Planned Features

  • Performance Optimization Module: Memory-efficient data processing benchmarks
  • Synthetic Healthcare Data Generator: OMOP CDM-compliant patient data
  • Customer Satisfaction Tracking: NPS drill-down analysis
  • Predictive Analytics: ML-based churn prediction models
  • Export Functionality: PDF/Excel report generation

Recent Updates

  • βœ… v0.2.0: Added Cohort Survival Analysis with Kaplan-Meier curves
  • βœ… v0.1.0: Initial release with Overview and Adoption pages

πŸ™ Acknowledgments

Built with:


Made with ❀️ for data-driven decision making

About

A Streamlit app to track performance metrics for Telecom initiatives

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages