Random Forest (Parallel Committee)
Builds 500 independent trees side-by-side at the same time and averages their votes. Very hard to break, needs minimal tuning, and resists noisy outliers gracefully.
Part 3 · Article 2 Stage 1 · Foundations
Decision trees, random forests, and boosted trees—how playing a smart game of '20 Questions' became the undisputed king of spreadsheet AI.
About 13–15 minutes
Think about how an experienced emergency-room doctor evaluates a patient with sudden chest pain. She doesn't multiply 40 decimal weights together in her head like a linear regression equation. Instead, she plays a rapid, structured game of yes-or-no questions: "Is the ECG showing ST-elevation? If YES, rush to the cath lab immediately. If NO, is the blood troponin elevated? If YES, admit for cardiac monitoring. If NO, is the pain reproduced when pressing on the rib cage?"
That exact branching flowchart is a Decision Tree—one of the most intuitive algorithms in all of machine learning [1]. Unlike a rigid hand-written rulebook from the 1980s, a machine-learning decision tree doesn't ask a human to guess which questions to ask or where to set the cutoffs. Instead, it scans thousands of past examples and discovers the sharpest yes-or-no splits automatically.
And when you combine hundreds of decision trees into a team—called a Random Forest or Gradient Boosted Trees—you get the undisputed champion of structured tabular data, regularly beating giant deep neural networks on hospital records, financial spreadsheets, and business tables [2].
ZappyWait—how does a computer decide which yes-or-no question to ask FIRST at the top of the tree?
Prof. BoltJust like in 20 Questions! Asking "Does it breathe?" splits the world cleanly in half; asking "Is it a purple flamingo?" wastes a turn. The algorithm picks whichever single question makes the resulting two piles as pure and neat as possible.
Imagine a basket holding 100 patients—50 who developed a post-surgical wound infection and 50 who healed cleanly. Right now, the basket is a 50/50 mess (maximum impurity). The decision tree tries out every possible yes-or-no split across every column in your spreadsheet:
The algorithm measures purity using simple math scores called Gini Impurity or Information Gain (Entropy) and locks in the single best question as the Root Node at the top of the tree. Then it repeats the exact same trick inside the left branch and the right branch—splitting again on smoking status, surgery duration, or steroid use—until each final bucket (called a Leaf) is mostly one clean answer.
Why do clinicians love single decision trees? Two reasons: first, they naturally handle tricky non-linear U-shapes and "IF A AND B together" interactions that break straight-line regression. Second, you can print the whole tree on a clinic wall poster and trace any patient's path with your finger in five seconds!
Single decision trees have one notorious weakness: they are twitchy and love to overfit. If you let a tree keep asking questions down to 20 levels deep, it will eventually carve out ridiculous hyper-specific leaves like "Age = 57 AND born on a Tuesday AND weight = 73.4 kg → Infected"—memorizing individual training patients by heart! Worse, if you remove just 5% of your training rows and regrow the tree, the entire top-to-bottom flowchart can flip into a totally different shape.
In 2001, statistician Leo Breiman unveiled a brilliant cure called the Random Forest [3]. Instead of trusting one lone, twitchy tree, grow 500 different trees and let them vote! To make sure all 500 trees don't just become identical clones making the exact same mistakes, Breiman added two deliberate doses of randomness:
When a brand-new patient arrives, all 500 trees run their own flowcharts and cast a vote. If 410 trees vote "High Risk" and 90 vote "Low Risk," the forest outputs a steady, calm 82% probability. Individual tree quirks cancel out, while true underlying medical patterns shine through.
Builds 500 independent trees side-by-side at the same time and averages their votes. Very hard to break, needs minimal tuning, and resists noisy outliers gracefully.
Builds trees one after another (XGBoost, LightGBM). Tree #1 makes rough guesses; Tree #2 studies only Tree #1's mistakes; Tree #3 fixes the leftovers—squeezing out world-class accuracy [4].
While generative chatbots steal the headlines, ask any working data scientist in healthcare, banking, or logistics what algorithm actually wins competitions on structured spreadsheets—and 9 times out of 10 they will say Gradient Boosted Decision Trees (especially tools named XGBoost and LightGBM).
Think of Random Forest like asking 500 independent doctors for a first opinion and taking the majority vote. Think of Gradient Boosting like a specialized relay team: Doctor #1 examines the patient and makes an initial estimate. Doctor #2 ignores everything Doctor #1 got right and focuses exclusively on fixing the subtle errors left behind. Doctor #3 fixes the tiny leftover errors from Doctors #1 and #2—continuing for hundreds of small, careful corrections.
In hospitals, boosted trees excel at predicting 30-day ICU readmissions, flagging early kidney injury from rolling lab panels, and estimating surgical blood-transfusion needs—handling missing lab values natively without crashing. The one trade-off? You lose the simple one-page poster of a single tree—though modern explainability tools (like SHAP values) can still show exactly how much each clue pushed a patient's score up or down [5].
| Tree Method | How It Works | Interpretability | Accuracy on Tables | Best Use Case |
|---|---|---|---|---|
| Single Decision Tree | One branching flowchart | Crystal clear (1-page poster) | Moderate; overfits easily | Quick bedside triage rules |
| Random Forest | 500 independent trees voting | Medium (feature importance) | High & very stable | Dependable out-of-the-box risk models |
| Gradient Boosting (XGBoost) | Sequential error-fixing relay | Medium (needs SHAP values) | Top-tier on spreadsheets | ICU early warnings, readmission, finance |
Left completely unsupervised, a decision tree is an obsessive perfectionist—it will keep asking yes-or-no questions until every single training patient sits alone in their own private leaf! That produces 100% training accuracy and miserable real-world test performance.
To keep trees sharp and generalizable, engineers act like skilled bonsai gardeners using three simple trimmers:
In fact, famous bedside clinical rules—like the Ottawa Ankle Rules (deciding whether a twisted ankle truly needs an X-ray) or the PECARN Pediatric Head Injury Tree (deciding whether a child with a head bump needs a CT scan)—follow the exact same pruned decision-tree philosophy: 3 to 5 crisp, high-impact questions that spare thousands of patients unnecessary radiation every year.
Random Forests and XGBoost automatically rank every column by how much purity it added across all 500 trees—instantly showing a hospital team that "creatinine trend" mattered 5x more than "resting heart rate."
Global importance tells you what matters on average; SHAP values zoom into a single patient—showing "+18% risk from rising lactate, +9% from fever, -6% from normal oxygen"—bringing human readability back to powerful forests.
Understanding where tree ensembles shine versus where deep neural networks take over saves huge amounts of time and money:
Trees Win Easily On: Messy real-world spreadsheets with mixed data types (age in years, yes/no flags, lab numbers, missing cells, and sharp clinical cutoffs like "fever > 38.5°C"). On 10,000-row hospital registries, XGBoost trains in two seconds on a laptop, needs zero feature scaling, and routinely beats giant neural networks.
Deep Learning Wins Easily On: Raw unstructured worlds—photographs, chest X-rays, pathology slides, spoken audio, and free-text medical notes—where asking "Is pixel #42,819 brighter than 128?" makes zero sense on its own.
ZappySo if my data lives in neat rows and columns, try Regression first and XGBoost/Random Forest second—and save Deep Learning for images, audio, and language?
Prof. BoltThat single rule of thumb puts you ahead of 90% of people chasing AI hype! Match the tool to the shape of your data, and you'll build faster, safer systems every time.
Checked December 2026. Source types are labelled. Dialogue is fictional.