Phase 06 · Predictive Modeling
I trained and compared 3 scikit-learn models for two prediction tasks: a regression model predicting state cancer incidence rates, and a binary classifier identifying high-risk states. All models use 13 environmental and lifestyle features from the Gold master risk profile.
Phase Purpose
The ML phase builds predictive models on top of the Gold master risk profile — going beyond correlation to quantify feature importance and test whether cancer outcomes are statistically distinguishable from environmental and lifestyle data alone. I use scikit-learn (not Spark MLlib, which is restricted in Databricks Free Edition serverless) running on the driver node — appropriate for this 51-state dataset.
I compare three model types for each task: a linear baseline (Ridge Regression / Logistic Regression), a Random Forest, and a Gradient Boosting model. The Random Forest feature importance provides the most analytically meaningful output — it captures non-linear effects and interaction terms that Pearson correlation misses entirely. PM2.5 days, for example, shows r=0.199 in correlation but 0.28 importance in Random Forest — the strongest single predictor for cancer incidence.
Results are interpreted with appropriate caution: models are trained and evaluated on the same 51 states (no held-out test set), so metrics reflect fit quality rather than true generalization. The practical value is in feature importance rankings and confirming that high-incidence states are statistically distinguishable from low-incidence states using publicly available data.
2 Notebooks · Click to Explore
Predicts state cancer incidence rate using Ridge Regression, Random Forest, and Gradient Boosting. Compares models by RMSE, R², and MAE. Extracts Random Forest feature importances revealing PM2.5 as the top predictor — ahead of smoking and COPD.
| Model | RMSE | R² | MAE |
|---|---|---|---|
| Gradient Boosting | 0.819 | 0.999 | 0.631 |
| Random Forest | 12.146 | 0.810 | 9.336 |
| Ridge Regression | 18.910 | 0.541 | 15.952 |
Binary classifier predicting whether a state is "high cancer incidence" (rate ≥ 500 per 100k). 16 of 51 states qualify. Logistic Regression (AUC=0.871) confirms a non-linear boundary — Random Forest and Gradient Boosting achieve perfect separation.
| Model | AUC | Accuracy | F1 |
|---|---|---|---|
| Random Forest | 1.000 | 1.000 | 1.000 |
| Gradient Boosting | 1.000 | 1.000 | 1.000 |
| Logistic Regression | 0.871 | 0.784 | 0.522 |