← Portfolio

T2D Risk Screener

Undiagnosed Type 2 Diabetes · Korean NHIS Data

Basic Information

Body Measurements

Blood Pressure

Urinalysis

Background

Type 2 diabetes is a significant and growing health burden in South Korea. A substantial proportion of people living with T2D are unaware of their diagnosis because the condition develops gradually and is often asymptomatic in its early stages. Early identification allows for lifestyle interventions that can delay or prevent progression to overt diabetes.

Data

This model was trained on the Korean National Health Insurance Service (NHIS) General Health Examination dataset — one million randomly selected adult subscribers who received a health check-up in 2024. The dataset is representative of the general insured adult population in South Korea.

Fasting plasma glucose (FPG) was used to construct the binary label: records with FPG ≥ 126 mg/dL were labelled as likely undiagnosed T2D. Patients whose records were flagged as likely known diabetics (on treatment) were not removed, as the NHIS dataset does not include treatment history; this is a known limitation.

Crucially, FPG itself was excluded from all model features. Because FPG directly measures blood glucose, including it would make the model nearly circular — essentially just applying a threshold to the answer it is supposed to predict. Instead, the model learns from indirect metabolic indicators: body composition, blood pressure, kidney function, liver enzymes, and lipid levels. This defines the tool's intended role: identify which patients are likely to benefit from a fasting glucose test, not to replace one. A positive screen should prompt an FPG or HbA1c measurement for confirmation.

Model

A CatBoost gradient-boosted decision tree was selected after comparing against a PyTorch tabular network and an sklearn MLP classifier. CatBoost was chosen for its strong performance, native support for categorical features without preprocessing, built-in missing-value handling, and CPU efficiency — making it practical to deploy without GPU infrastructure.

Raw model probabilities were calibrated using Platt scaling (logistic regression on validation-set logits). The screening threshold was selected to achieve a sensitivity (recall) of at least 85% on the validation set, reflecting the asymmetric cost of a missed case versus a false positive in a population screening context.

Performance (test set)

MetricValue
ROC-AUC
Average precision
Brier score

Feature importance

The chart below shows the mean absolute SHAP value for each feature across a 5,000-row sample of the held-out test set — a measure of how much, on average, each feature contributes to the model's predictions.

Limitations

  • The model identifies statistical risk patterns and does not diagnose diabetes. A fasting plasma glucose test or HbA1c measurement is required for diagnosis.
  • Training data is from South Korea (2024 cohort). Generalisability to other populations may be limited.
  • In the NHIS dataset, laboratory tests (hemoglobin, creatinine, liver enzymes, lipids) were ordered at a clinician's discretion, so patients who had them measured tended to be sicker on average. The model learned this pattern: absent lab values act as a weak signal of lower risk. As a result, predictions without any laboratory input may substantially underestimate risk in patients who simply haven't been tested.
  • The FPG-based label does not distinguish between newly detected and previously known (but poorly controlled) diabetes.
  • This is a research portfolio project and has not been clinically validated.

Source code

All code, training scripts, and the analysis notebook are available on GitHub.