01The stroke dataset and why it is hard
The capstone uses a stroke-risk dataset from a Ugandan Regional Referral Hospital: age, gender, hypertension, heart disease, average glucose level, BMI, smoking status, work type, residence — and whether the patient had a stroke. Three properties make it a good teacher:
- Missing values — BMI is blank for a few percent of patients.
- Categorical strings —
work_type,smoking_statusneed encoding before most models can use them. - Extreme class imbalance — only about 4.9% of patients had a stroke.
Each of these has a correct, standard treatment. The danger is applying it in a way that quietly leaks information or optimises the wrong metric.