Data Science2023
Pima Indians Diabetes — Clinical Risk Modeling
A disciplined walk through the most-studied dataset in clinical machine learning.
- EDA as a safety procedure
- Sensitivity over vanity accuracy
- Models explained through interface
- Records
- 768 patients
- Features
- 8 clinical measures
- Key finding
- Zeros = hidden missing data
- Evaluation
- Sensitivity-first
01
Overview
The Pima Indians Diabetes dataset — 768 patient records, eight clinical measurements, one binary outcome — is the fruit-fly of medical machine learning: small enough to know completely, treacherous enough to teach real lessons. This project works it end to end: exploratory analysis, the famous hidden-missing-data problem, feature relationships, and classification models evaluated the way a clinical context would demand.
02
Problem
Medical data punishes carelessness. In this dataset, missing measurements were recorded as zeros — a zero blood pressure or zero BMI is not a healthy patient, it is an absent reading. Any model trained without noticing inherits the error invisibly. The project treats that trap, and the evaluation choices that follow, as the actual subject.
03
Goals
- Expose and correctly handle the disguised missing values before any modeling
- Understand feature relationships — glucose, BMI, age, pregnancies — and their interaction with the outcome
- Compare classifiers with metrics that matter clinically, where false negatives and false positives carry different costs
04
Solution
EDA begins with distribution plots per feature, which is exactly where the zeros give themselves away — impossible spikes at zero for glucose, blood pressure, skin thickness, insulin, and BMI. These are converted to explicit missing values and imputed deliberately rather than silently.
Correlation and pairwise analysis establish glucose as the dominant signal with BMI and age as secondary structure, setting expectations for what any model can achieve on eight features.
The modeling pass trains standard scikit-learn classifiers with cross-validation, then reads results through the confusion matrix rather than accuracy alone — because on an imbalanced clinical outcome, sensitivity is the number that matters.
Tooling
Tech stack
- Python
- pandas
- seaborn
- scikit-learn
- Jupyter
Friction
Challenges
Missing data wearing a disguise
Nothing in the schema says zero means missing; only domain reasoning does. It is the cleanest demonstration I know that EDA is a safety procedure, not a formality.
Small data, honest ceilings
768 rows will overfit under enthusiastic tuning. Cross-validation and restraint about model complexity matter more here than any algorithm choice.
Takeaways
Lessons learned
- Distribution plots are diagnostic instruments — the missing-data problem is invisible in summary tables and obvious in histograms
- Accuracy is the wrong headline metric for imbalanced clinical outcomes; report sensitivity and precision or report nothing
- On small tabular data, careful preprocessing outperforms model sophistication every time
Evidence
Dataset
Pima Indians Diabetes Database
UCI / Kaggle — National Institute of Diabetes and Digestive and Kidney Diseases
768 female patients of Pima Indian heritage, 8 clinical features (glucose, blood pressure, BMI, insulin, age, pregnancies, skin thickness, pedigree), binary diabetes outcome.
View datasetRoadmap
Future improvements
- Compare imputation strategies and quantify their effect on downstream sensitivity
- Calibration analysis — do predicted probabilities mean what they claim
- SHAP-based per-patient explanation layer
Rebuilt for this site from the original repository — source history