mc18102001/life-expectancy-predictor
Life Expectancy Predictor
Public Health & Policy Analytics | Interpretable Modeling
Overview
This project is an end-to-end analytics application that predicts country-level life expectancy (in years) and classifies countries into High Life Expectancy or Low Life Expectancy groups using interpretable statistical models.
Rather than focusing only on accuracy, the project emphasizes explainability and decision support, making the results understandable and usable for non-technical stakeholders such as policymakers, public health analysts, and development organizations.
The solution is deployed as an interactive Streamlit web application.
Problem Statement
Life expectancy varies widely across countries due to differences in healthcare systems, disease burden, education, and socio-economic development. Although large public datasets exist, these data are often underutilized for practical, data-driven decision making.
This project addresses the question:
Which health and socio-economic factors are most strongly associated with life expectancy outcomes, and how can these relationships be communicated clearly to support policy and public health decisions?
Data Description
- Country-level public health and socio-economic indicators
- Features include:
- Mortality indicators (adult mortality, infant deaths, under-five deaths)
- Disease burden (HIV/AIDS, measles)
- Vaccination coverage (polio, diphtheria, hepatitis B)
- Education and income indicators (schooling, income composition)
- Health expenditure indicators
- Development status (Developed vs Developing)
Target Variables
- Life Expectancy (years) — continuous target
- Life Expectancy Category — High vs Low (binary classification)
Methodology
Phase 1: Exploratory Data Analysis (EDA)
- Distribution analysis of life expectancy across countries
- Comparison of developed vs developing countries
- Identification of missing values and data quality issues
- Initial pattern discovery across health and economic indicators
Phase 2: Data Cleaning & Preprocessing
- Median imputation for missing numeric values
- Feature scaling using
StandardScaler - Encoding of categorical variables
- Reproducible train/test split
Phase 3: OLS Regression (Prediction)
- Ordinary Least Squares regression used to predict life expectancy in years
- Focus on interpretability of coefficients
- Performance:
- R²: 82.4%
- RMSE: 3.91 years
Phase 4: Logistic Regression (Classification)
- Binary classification: High Life Expectancy vs Low Life Expectancy
- Performance:
- Accuracy: 89.6%
- ROC-AUC: 96.1%
- Balanced precision and recall across classes
Phase 5: Deployment & Explainability
- Models, scaler, feature list, and training medians saved as a single artifact
- Interactive Streamlit app with:
- Simplified single-prediction interface
- Realistic default inputs based on training medians
- Visual model explanations (green/red bar charts)
- Plain-English summaries for non-technical users
Application Features
Dashboard
- Displays key model performance metrics with correct units
- Includes a short “How to use this app” guide for first-time users
Single Prediction
- Predicts life expectancy (years)
- Classifies outcome as High Life Expectancy or Low Life Expectancy
- Shows probability of High Life Expectancy
- Side panel explains what each feature represents
Model Insights
- OLS visualization: factors that increase or decrease predicted life expectancy (in years)
- Logistic visualization: factors pushing predictions toward High or Low Life Expectancy
- Color-coded charts (green = positive, red = negative)
- Hover tooltips and plain-English explanations
- Feature filters (Health vs Economic indicators)
Industry & Domain Relevance
This project supports real-world use cases in:
- Public Health Analytics
- Policy & Development Analytics
- Global Health & Social Impact Organizations
- Healthcare and Analytics Consulting
The analysis is designed for population-level decision support, not clinical or patient-level diagnosis.
Interpretation Notes & Limitations
- Results represent associations, not causal relationships
- Observational country-level data may hide within-country variation
- Correlated features can affect coefficient interpretation
- Data quality depends on reporting standards across countries
Tech Stack
- Python, Pandas, NumPy
- Statsmodels (OLS regression)
- Scikit-learn (Logistic Regression, Scaling)
- Streamlit (UI & deployment)
- Altair (interactive visualizations)
- Joblib (model artifact management)
Key Takeaway
This project demonstrates how interpretable models combined with thoughtful UI design can transform underutilized public health data into clear, actionable insights for real decision-makers.
