Skip to content

About

2010-2021 Neurological Cancer Demographic Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Predicting Neurological Cancer Risk from Demographic Data

A regression-based screening tool for neurological cancer mortality, trained on the IHME Global Burden of Disease (GBD) 2021 dataset, with an interactive widget interface intended as a low-cost, accessibility-first risk indicator — not a diagnostic.

Course: CSE 163 Intermediate Data Programming — University of Washington (Spring 2025) Authors: Aurora Liu · Noah Brown · Ru Li Status: Final project — CSE 163, Spring 2025


Motivation

Neurological cancers (brain & CNS tumors) are among the most lethal cancers because they progress silently and require expensive imaging or invasive biopsy to detect. Early detection is the strongest predictor of survival, but advanced diagnostics are out of reach for a large fraction of the global population.

We asked: can we build a useful first-line risk estimator from demographic data alone? A model that runs in a browser and asks three questions could plausibly nudge high-risk individuals toward earlier screening — particularly in regions without easy access to MRI or neuro-oncology specialists.

Research Questions

  1. How does brain cancer mortality vary across age, sex, year, and Socio-Demographic Index (SDI) groups?
  2. What demographic factor most strongly predicts neurological-cancer mortality across countries, years, age groups, and sexes?
  3. Primary: can we accurately predict neurological-cancer mortality from demographic data alone (year, location, sex, age)?

Data

  • Source: IHME Global Burden of Disease (GBD) 2021
  • Scope: 237 countries / regions, 2010–2021, neurological cancer mortality only
  • Raw shape: ~500K rows × 16 columns
  • Cleaned shape: ~173K rows × 6 columns after dropping unused identifiers and filtering to standard 5-year age bins (age_id 6–21)

The raw CSV is not committed to this repository (it is large and freely re-downloadable from IHME). The notebook fetches a working copy from a shared Google Drive at runtime via gdown; for a fresh download, see the IHME GBD Results Tool linked above.

Methods

Data preparation

  • Drop redundant ID and CI columns (cause_id, metric_id, upper, lower, …)
  • Filter to standard 5-year age bins
  • One-hot encode location_name and sex_name
  • 80 / 20 train / test split

Models compared (src/project.py)

A RegressionMachine class wraps four scikit-learn regressors with a uniform fit / evaluate / inspect interface:

Model Hyperparameter search Output
Ordinary Least Squares none MSE, R², top-10 coefficients
Lasso LassoCV (5-fold) MSE, R², α, top-10 coefficients
Decision Tree GridSearchCV over max_depth ∈ {10, 25, 50, 100} MSE, R², best depth
Random Forest default RF (≈ 0.5 GB serialized model) MSE, R², serialized via joblib

Interactive risk calculator (RiskTool class)

A self-contained ipywidgets + ipyleaflet UI that:

  1. Asks the user for sex, age bracket, and country (clickable world map).
  2. Constructs a single-row inference frame in the exact format the trained Random Forest expects.
  3. Returns the user's predicted-deaths-per-year as a log-ratio against the global median, rather than as a raw number, so a non-expert reader can interpret it.

Testing

A small TestRegressionMachine class verifies output shape and key invariants (e.g. that location-based coefficients dominate the top 10).

Results

Model MSE R²
OLS 23,921 0.660
Lasso 24,587 0.650
Decision Tree (depth 100) 324 0.995
Random Forest ≈ 1,330 ≈ 0.99

Interpretation (with deliberate caution):

  • The tree-based models look like silver bullets but are almost certainly overfitting the one-hot region encoding — every "Global", "WHO region", "Four world regions" row in the data is essentially memorized.
  • The OLS and Lasso top-10 coefficients are dominated by location features (Southeast Asia, East Asia and Oceania, Middle SDI, China, …), each with effects > 1,600 deaths. Age and sex never make the top 10.
  • In other words, raw demographic variables matter much less than where you live, which is itself a proxy for healthcare access, environmental exposure, and reporting completeness.

This is a real, important finding for a "demographic-only" screening tool: it learns access to diagnosis as much as it learns disease.

Limitations

  1. Death counts are not population-normalized. A larger country contributes more raw deaths regardless of incidence rate.
  2. Diagnostic coverage varies by country. Low-SDI regions report fewer deaths because cases are underdiagnosed, not because incidence is lower — a clear bias in any model trained on these data.
  3. Three-question screening is not a diagnosis. The risk widget is explicitly framed as a context-builder, not a clinical decision tool.

Repository structure

.
├── README.md                  ← this file
├── requirements.txt           ← Python dependencies
├── .gitignore
├── docs/
│   └── proposal.pdf           ← original CSE 163 project proposal
├── notebooks/
│   └── analysis.ipynb         ← end-to-end notebook (data → models → widget)
└── src/
    └── project.py             ← clean module version of the analysis

Reproducing the analysis

This project was developed in Google Colab, which is the easiest environment to re-run it in (the interactive widgets, the geospatial map layer, and the dataset download all work there out-of-the-box).

Option A — Open in Colab (recommended):

  1. Upload notebooks/analysis.ipynb to your Google Drive, or open it directly via Colab's GitHub integration.
  2. Run all cells. The notebook will download the GBD CSV and the widget assets on the first run.

Option B — Run locally:

git clone https://github.com/ruuuuthful/Group-9-Final-Project-Dataset.git
cd Group-9-Final-Project-Dataset
pip install -r requirements.txt
jupyter lab notebooks/analysis.ipynb

A few cells reference Colab-only helpers (google.colab.files, google.colab.drive); these will need to be adapted or skipped when running locally.

Author contributions

This was a genuine team project; the breakdown below reflects each member's primary focus.

  • Ru Li — Exploratory data visualization (Research Question 1: SDI / age / year / sex bar plots) and regression modeling (RegressionMachine class covering OLS, Lasso, and Decision Tree, including hyperparameter tuning and top-10 coefficient analysis).
  • Aurora Liu — Data acquisition and preprocessing pipeline (prep_data), including pulling the raw GBD CSV and producing the cleaned analysis-ready frame.
  • Noah Brown — Random Forest training and serialization, plus contributions to model evaluation across the pipeline.

All authors contributed to writing the report and to discussions of model interpretation and limitations.

Acknowledgements

CSE 163 staff at the University of Washington (Spring 2025) for the course infrastructure and the data-programming methods this project builds on. IHME for making the GBD data publicly available.

About

2010-2021 Neurological Cancer Demographic Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages