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.

- Real-time KPI tracking (Revenue Impact, Churn Rate, NPS)
- Interactive time-series visualizations with Plotly
- Performance metrics with delta indicators
- Historical trend analysis
- User adoption rate tracking
- Daily Active Users (DAU) and Monthly Active Users (MAU) monitoring
- Engagement intensity metrics (DAU/MAU ratio)
- Growth trend visualizations
- 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)
- Python 3.11+ (recommended: 3.11 or 3.12)
- uv package manager (recommended) or pip
# 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# 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# With uv
uv run streamlit run app.py
# With pip
streamlit run app.pyThe dashboard will open automatically in your browser at http://localhost:8501
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)
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
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
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)
Core Libraries:
streamlit>= 1.20.0 - Web application frameworkpandas>= 1.4.0 - Data manipulationplotly>= 5.10.0 - Interactive visualizationsnumpy>= 1.20.0 - Numerical computing
Analytics Libraries:
lifelines>= 0.30.0 - Survival analysis (Kaplan-Meier, Cox PH)scipy>= 1.16.3 - Statistical functionsscikit-learn>= 1.7.2 - Machine learning utilities
Data Generation:
faker>= 37.12.0 - Synthetic data generation
Development Tools:
pytest>= 8.4.2 - Testing frameworkblack>= 25.9.0 - Code formattingflake8>= 7.3.0 - Code linting
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
- Navigate to 𧬠Cohort Analysis page
- Select cohorts from the sidebar (e.g., "User Segments")
- View survival curves and retention metrics
- Compare cohorts using statistical tests
- Export results for further analysis
- Y-axis: Probability of remaining active (0-100%)
- X-axis: Days since user signup
- Shaded areas: 95% confidence intervals
- Higher curves: Better retention
- 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)
# Test cohort builder functions
uv run python utils/cohort_builder.pyExpected output:
- β Loaded N users
- β Created cohort definitions
- β Assigned cohorts with boolean columns
- β Calculated survival data (duration, event_observed)
- β Generated cohort summary statistics
# Test Kaplan-Meier analysis
uv run python module/cohort_analysis.pyExpected output:
- β Kaplan-Meier analysis for selected cohorts
- β Survival summary table
- β Log-rank test results
- β Hazard ratios (Cox PH)
- β Comparison matrix
- Create module file:
module/new_page.py - Implement display function:
def display_page(): st.title("New Page Title") # Your page logic here
- Register in app.py:
from module import new_page PAGES = { # ...existing pages... "π New Page": new_page.display_page, }
# Format code with black
uv run black .
# Lint with flake8
uv run flake8 .# Run all tests
uv run pytest tests/ -v
# Run with coverage
uv run pytest tests/ --cov=utils --cov=module| 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 |
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes and commit:
git commit -m "Add: brief description of changes" - Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request
- Follow PEP 8 style guidelines
- Add docstrings to all functions
- Include unit tests for new features
- Update README for user-facing changes
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: See
doc/folder for detailed feature guides
This project is open source and available under the MIT License.
- 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
- β v0.2.0: Added Cohort Survival Analysis with Kaplan-Meier curves
- β v0.1.0: Initial release with Overview and Adoption pages
Built with:
- Streamlit - Interactive web apps
- Plotly - Interactive visualizations
- Lifelines - Survival analysis
- Pandas - Data manipulation
Made with β€οΈ for data-driven decision making