MLML CapstoneAdvanced

Life Expectancy ML Capstone

End-to-End Regression, Classification & Explainable Predictions

Built an end-to-end machine learning workflow on WHO life-expectancy data covering EDA, regression, classification, ensemble tuning, model persistence, and structured LLM-powered explanations.

Built under academic requirements during the Masai AI/ML course.
0.9923
Test ROC-AUC
0.9898
CV ROC-AUC
2,938
Records
Detailed workflow

System Architecture

Academic end-to-end ML workflow documented in the life-expectancy capstone.

Verify on GitHub
01 · Data1

WHO life-expectancy records

2,938 country-year records enter a documented exploratory and modeling workflow.

02 · Prepare2

Task-aware preprocessing

Cleaning, encoding, scaling, feature selection, and splits are applied for regression and classification.

03 · Compare3

Model baselines

Multiple algorithms establish comparable baselines before more expensive tuning.

04 · Tune4

Cross-validated ensembles

Grid search and cross-validation select stronger models while preserving evaluation discipline.

05 · Deliver5

Saved model + explanation

Persisted artifacts support repeatable inference and structured LLM-assisted explanations.

Quality gates
Leakage-safe preprocessing
Cross-validation
Held-out ROC-AUC
Validated output

0.9923 test ROC-AUC with 0.9898 cross-validation ROC-AUC.

Project Overview

This capstone uses 2,938 country-year records from the WHO Life Expectancy dataset to study demographic, healthcare, economic, and social indicators associated with life expectancy.

The workflow progresses from data cleaning and exploratory analysis to regression and classification baselines, ensemble models, five-fold cross-validation, GridSearchCV tuning, and serialization of the best reusable pipeline.

The final stage adds a guarded LLM explanation layer around model predictions, including structured JSON validation, PII protections, and a deterministic mock fallback for reproducible execution without API credits.

The tuned Random Forest pipeline achieved a mean cross-validated AUC of approximately 0.9898 and a test-set AUC of approximately 0.9923 on the project dataset.

Problem

Life expectancy is influenced by interacting health, demographic, and socioeconomic variables, requiring a reproducible workflow that can compare models and explain predictions responsibly.

Solution

Created a four-part ML capstone spanning preprocessing, statistical exploration, regression and classification, ensemble tuning, saved model artifacts, and structured natural-language prediction explanations.

Project Snapshot

0.9923
Test ROC-AUC
0.9898
CV ROC-AUC
2,938
Records