Data
A collection of recorded facts. Here, each row describes one historical example and each column describes one feature.
Science companion
This guide explains what the model sees, how each measurement is collected, how the computer learns, and what students should say during the exhibition.
First principles
A collection of recorded facts. Here, each row describes one historical example and each column describes one feature.
A relationship that appears repeatedly—for example, a combination of several measurements that often appears with one outcome.
A mathematical system created during training. It stores learned coefficients, not copies of classroom visitors.
The model applies its learned mathematics to a new fictional row and returns a pattern-match score.
The 13 model inputs
These are descriptions of the historical dataset—not instructions to perform medical tests at school. Tests such as stress ECGs and angiography must only be performed by qualified professionals.
Information read from the historical record
ageyearsSimple meaning: How many complete years old the person was.
How obtained: From the person’s date of birth or medical record. It is not measured by the AI.
What the model receives: One number, such as 55.
Why it can matter: Body systems and disease patterns can change with age. Age alone never decides the result.
sex0 or 1Simple meaning: The historical file stores two sex categories: 0 = female and 1 = male.
How obtained: From the original medical record; the model does not examine or measure a person.
Limitation: A binary field does not represent everyone. It also contains no information about gender identity. This is a clear example of how old datasets can limit an AI system.
Recorded while the person was not exercising
chest-paincodes 1–4Simple meaning: A clinician classified the reported symptoms—not how painful they felt.
1 Typical angina: classic exertion-related pattern2 Atypical angina: some, but not all, classic features3 Non-anginal pain: does not fit the classic pattern4 Asymptomatic: no chest-pain symptom reportedHow obtained: By asking questions about the symptom, what brings it on, and what relieves it. Only a clinician should classify real chest pain.
Important: “Asymptomatic” does not mean “healthy”; it only says the symptom was not reported.
rest-bpmmHgSimple meaning: Blood pressure is the force of blood pushing against artery walls. A normal reading has two numbers, such as 120/80.
How measured: An inflatable cuff called a sphygmomanometer wraps around the upper arm. As air is slowly released, the device detects pressure.
What this dataset stores: Only the systolic value—the first number, when the heart contracts—recorded at rest on hospital admission. Example: 130.
Unit: mmHg means millimetres of mercury, a pressure unit. The second, diastolic value is not included.
serum-cholmg/dLSimple meaning: Cholesterol is a waxy, fat-like substance carried in blood. The body needs some, but certain patterns can be linked with plaque in arteries.
How measured: A health professional takes a blood sample. A laboratory measures cholesterol in the liquid part of blood, called serum.
What this dataset stores: One serum-cholesterol number. It does not separately show LDL (“bad”), HDL (“good”), or triglycerides.
Unit: mg/dL means milligrams of substance in one decilitre (100 mL) of blood.
fasting-blood-sugar0 or 1Simple meaning: Glucose is a sugar in the blood and a main source of energy for cells.
How measured: Usually from a blood sample after no food or drink except water for at least eight hours.
What this dataset stores: Not the exact measurement. It stores 0 = 120 mg/dL or lower and 1 = above 120 mg/dL.
Information loss: Values of 90 and 119 both become 0; values of 121 and 200 both become 1. This shows how converting a measurement into a yes/no category removes detail.
electrocardiographiccodes 0–2Simple meaning: An electrocardiogram—ECG or EKG—is a painless recording of the heart’s electrical activity.
How measured: Sticky sensors called electrodes are placed on the chest, arms, and legs. Wires connect them to a machine that draws a waveform.
0 Normal historical ECG category1 ST–T wave abnormality2 Probable or definite left-ventricular hypertrophy by the dataset’s criteriaVocabulary: ST and T are sections of the ECG trace related to the lower chambers recovering electrically. The left ventricle is the main pumping chamber; hypertrophy means thickening.
Monitored by healthcare professionals while exercise becomes harder
max-heart-ratebpmSimple meaning: The fastest recorded heartbeat reached during the exercise test—not the resting pulse.
How measured: ECG electrodes detect each heartbeat while the person exercises. The machine counts beats per minute.
Unit: bpm means beats per minute. Example: 150 bpm.
Important: A value cannot be judged alone; age, medicines, fitness, the test protocol, symptoms, and other information matter.
angina0 or 1Simple meaning: Whether angina-like chest discomfort occurred when the heart worked harder during the test.
How obtained: The person reports symptoms while professionals monitor the ECG, blood pressure, and condition.
Dataset codes: 0 = no, 1 = yes.
Safety: Students must never copy an exercise stress test. It is a supervised clinical procedure with stopping rules.
oldpeakdecimal valueSimple meaning: The model compares the ST section of the ECG during exercise with the ST section at rest. A downward change is called ST depression.
How measured: A clinician or ECG system compares the stress-test waveform with the resting waveform.
What the dataset stores: A decimal such as 1.2 or 2.4. The official Statlog description does not state a unit, so the project should say “dataset value,” not invent a unit.
Name warning: “Oldpeak” is an old dataset column name; it does not mean an old heart rate.
slopecodes 1–3Simple meaning: At peak exercise, the ST part of the ECG line can trend upward, stay relatively flat, or trend downward.
How measured: From the ECG waveform during the stress test.
1 Upsloping2 Flat3 DownslopingImportant: The code is a category, not an angle measured by the student.
Specialist procedures represented as simplified codes
major-vessels0–3 vesselsSimple meaning: The historical data records how many major heart vessels became visible (“coloured”) during X-ray imaging with contrast dye.
How obtained: In coronary angiography, a clinician guides a thin catheter through a blood vessel, injects contrast dye, and uses moving X-ray images called fluoroscopy.
What the dataset stores: A count from 0 to 3, not the X-ray image itself.
Safety: This is an invasive hospital procedure with risks. It is explained only because the public dataset contains the result.
thalcodes 3, 6, 7Simple meaning: A historical coded scan result associated with the heart’s blood-flow testing.
3 Normal6 Fixed defect: the abnormal-looking area remains7 Reversible defect: the area changes between stress and restHow obtained: This field is commonly linked with a thallium/nuclear stress scan, in which a tracer and special camera show blood flow at stress and rest.
Careful wording: The official Statlog file calls the field only “thal” and supplies the codes. Present it as a historical scan code; do not call it a test for thalassemia.
This is the label, not an input
class1 or 2Simple meaning: The historical answer paired with the 13 inputs so the model can learn.
Original codes: 1 = absence and 2 = presence of the dataset’s heart-disease outcome. The app converts these internally to 0 and 1 for machine learning.
Why it is not entered: For a new sample, this answer is unknown. Predicting a pattern related to this label is the model’s task.
Show the judges
This is the first public record in the bundled file. It is a de-identified historical training example—not a visitor and not one of the fictional demo profiles.
70.0 1.0 4.0 130.0 322.0 0.0 2.0 109.0 0.0 2.4 2.0 3.0 3.0 2Fourteen values separated by spaces: 13 inputs followed by 1 known outcome.
| # | Column | Stored value | Human-readable meaning | Kind of data |
|---|---|---|---|---|
| 1 | Age | 70 | 70 years | Number |
| 2 | Sex | 1 | Male in the historical coding | Category |
| 3 | Chest-pain pattern | 4 | Asymptomatic category | Category |
| 4 | Resting blood pressure | 130 | 130 mmHg systolic | Number |
| 5 | Serum cholesterol | 322 | 322 mg/dL | Number |
| 6 | Fasting blood sugar flag | 0 | Not above 120 mg/dL | Yes/no category |
| 7 | Resting ECG | 2 | Historical LVH category | Category |
| 8 | Maximum heart rate | 109 | 109 bpm during exercise test | Number |
| 9 | Exercise angina | 0 | No | Yes/no category |
| 10 | Oldpeak | 2.4 | ST-depression dataset value of 2.4 | Decimal number |
| 11 | ST slope | 2 | Flat | Ordered category |
| 12 | Major vessels | 3 | 3 vessels coloured by fluoroscopy | Count |
| 13 | Thal scan code | 3 | Normal category | Category |
| 14 | Known outcome | 2 | Presence class in the source dataset | Target label |
One example, arranged horizontally. This dataset has 270 rows.
One type of information repeated for every row.
An input column used by the model. There are 13 features.
The known answer used during supervised training.
Inside the computer
It is called “regression,” but here it is used for classification: choosing between two learned classes.
Numeric features are standardized: the training average is subtracted and the result is divided by the training spread. This puts different units on comparable scales.
standardized value = (value − training average) ÷ training spreadOne-hot encoding turns each category into switches. For ST slope, the computer can create three switches: upsloping, flat, and downsloping. Exactly one is on.
Flat → [0, 1, 0]During training, logistic regression adjusts a weight called a coefficient for every prepared input. A positive contribution pushes toward the presence pattern; a negative contribution pushes toward the absence pattern.
weighted total = bias + (weight₁ × input₁) + …The sigmoid function bends any weighted total into a number between 0 and 1. The app multiplies it by 100 and calls it a pattern score.
score = 1 ÷ (1 + e−weighted total)The app uses display thresholds. These are project choices, not medical cut-offs.
The XAI panel multiplies each prepared input by its coefficient, groups encoded categories back into their original feature, and shows the four largest absolute contributions.
local contribution ≈ prepared input × learned coefficientA broad name for computer systems that perform tasks associated with human intelligence, such as recognizing patterns.
A type of AI where a computer learns a mathematical pattern from examples instead of receiving every rule by hand.
A step-by-step procedure. Logistic regression is the learning algorithm used here.
The trained mathematical result—the coefficients and preprocessing learned from the training data.
Learning from examples that include both inputs and a known correct label.
Assigning an example to a class. The source classes are absence and presence.
The process of adjusting coefficients using historical examples and known outcomes.
Using the already-trained model on a new row. The model does not retrain for each visitor.
A learned weight that controls how strongly a prepared input affects the weighted total.
Giving the two outcome groups balanced importance during learning so one class does not dominate simply because it has more rows.
Split data into five parts. Train on four and test on the remaining part, repeat five times, then combine the test results. Every row is tested while outside its training fold.
The percentage of test examples assigned to the correct class at a 50% decision threshold. This project’s out-of-fold accuracy is 84.4%.
A score of how well the model ranks presence examples above absence examples across all possible thresholds. 50% is chance-like; 100% is perfect on that test set. Here it is 89.9%.
Methods that help people inspect why a model produced a result instead of showing only an answer.
A systematic unfair or inaccurate tendency, often caused by incomplete, unbalanced, or unrepresentative data. “Bias” also has a separate mathematical meaning: the intercept in the equation.
Protecting information about people. This app uses public de-identified training data and does not store visitor entries.
A fair test
Why not test on the same rows used for learning?
That would be like giving a student the answer sheet before an exam. A model could memorize details and appear better than it is.
Does 84.4% mean the model is medically ready?
No. It describes performance on this small historical dataset only. Clinical AI needs much larger, diverse, independently validated data and professional review.
Student access
The demonstration script and judge-question answers are now kept on a password-protected page.
Sources
External sources require internet access, but the medical and AI explanations are included on this page and in the printable project guide.