decision tree
/ dih-SIZH-un tree /
A decision tree makes a prediction the way a careful doctor or a customs officer would — by asking a series of yes-or-no questions, each one narrowing things down, until a verdict is reached. Is the temperature above 38°C? If yes, is there a cough? If yes, predict flu. It's a flowchart the computer builds for itself from data, and you can literally read the finished tree top to bottom and follow exactly why it decided what it did.
The machine builds the tree greedily, one question at a time. At each step it scans every feature for the single split that best separates the examples into purer groups — say, the cut that lands almost all the spam on one side and almost all the legitimate mail on the other. It then repeats inside each branch, splitting again and again, until the groups are clean enough or it hits a stopping rule. Each branch ends in a leaf that holds the final answer for everything that reaches it.
Its great virtue is transparency: in fields like medicine and lending, being able to explain a decision is sometimes as important as making it. Trees also handle numbers and categories together and need little data preparation. But a single tree is a fragile thing — let it grow unchecked and it will memorize the training data down to the noise, a classic case of overfitting, and tiny changes in the data can reshuffle the whole tree. That fragility is exactly why people rarely use one alone, and instead combine many into a random forest or a boosted ensemble.
A bank's loan tree: first split on "income > $40k?" — no goes left toward "deny." Yes goes right and splits again on "existing debt > half of income?" — yes leans deny, no reaches a leaf marked "approve." Any applicant can be traced down a single path of three questions to the answer.
A readable flowchart of yes/no splits — its transparency is the selling point.
A lone tree left to grow without limits almost always overfits — it ends up explaining the past perfectly and the future poorly. Pruning it (cutting back weak branches) or limiting its depth keeps it honest; combining many is how forests and boosting fix it for good.