AI GLOSSARY · AI CONCEPTS
Decision tree
Definition
A prediction decision tree follows feature tests from a root to a leaf supplying a class, probabilities or a numeric prediction. Trees support classification and regression; splits can be binary or multiway and involve one or several features.
Also called: decision trees, decision tree machine learning, decision tree algorithm, decision tree classifier, decision tree regression.
In plain language
A decision tree works like a game of twenty questions. To decide whether a loan applicant is likely to repay, it might first ask whether income is above a level, then whether there are past defaults, and each answer sends you down a different branch until you reach a final answer. The tree is built from past examples, which pick the questions. Its big appeal is that you can read it. Its weakness is that a tree grown too deep memorises its training examples, and a small change in the data can produce a very different tree. Teams often limit depth or combine many trees.
Technical definition
IBM describes a decision tree as a non-parametric supervised learning algorithm used for classification and regression, with a root node, branches, internal (decision) nodes and leaf nodes. The scikit-learn user guide says the goal is a model that predicts a target value by learning simple decision rules inferred from the data features, and that a tree can be seen as a piecewise constant approximation. It lists advantages such as being simple to interpret and visualise, and disadvantages: trees can overfit, mitigated by pruning, a minimum number of samples at a leaf or a maximum depth, and can be unstable because small variations in the data might produce a completely different tree. It suggests using trees within an ensemble to mitigate this.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Skill by Skill Almanac · Illustrative, not executed
expense-categorizer-rules 42/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A bank transactions CSV categorised with ordered keyword rules where the first match wins, with totals per category and the uncategorized rows reported.
- Why it exercises the concept
- A hand-written contrast case, not a decision tree. It resembles a tree in that conditions are checked in a fixed order and the first match decides. A decision tree learns its conditions and their order from labelled data. The catalogue has no training skills.
Skill by Skill Almanac · Illustrative, not executed
split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A JSON report on train, validation and test files that flags duplicates, shared groups, time leakage and label leakage between the splits.
- Why it exercises the concept
- Not a training skill. A deep tree can memorise its training rows, so a clean held-out set is how you see the overfitting that IBM and scikit-learn describe. This skill checks that the sets are separate.
Skill by Skill Almanac · Illustrative, not executed
data-analysis-eda 56/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.
- Why it exercises the concept
- Not a training skill. Profiling a table before fitting a tree shows its columns, missing values and class balance, which decide what the tree can learn.
How it shows up when you use agents
If you ask Claude Code, Codex or Cursor to build a quick classifier on a table, a decision tree is one method it may pick, and the scikit-learn guide notes that trees are simple to interpret and can be visualised. In scikit-learn the classes are DecisionTreeClassifier and DecisionTreeRegressor. Trees are also the building block of random forests and gradient boosting, so you meet them inside those methods even when you do not ask for one.
What breaks when this is misunderstood: an unrestricted tree can reach a perfect score on its training rows and do poorly on new ones, which is overfitting. People then read the readable rules as a causal explanation, when they only describe patterns in the sample.
The safer habit is to ask the agent for the depth limit or pruning it used, the training and held-out scores side by side, and the rules it found. The catalogue has no skills for training models, so the skills on this page are contrast cases and data checks. Decision trees are one kind of supervised learning and one example of a machine learning algorithm.
Worked example (illustrative)
Consider a hand-specified two-leaf tree: if latency_ms > 100, predict “slow”; otherwise predict “fast”. Inputs 80 and 140 follow different branches and return “fast” and “slow”. This illustrates prediction in a tree. The threshold was chosen for the illustration, not learned from data, so it is not evidence of a trained machine-learning model or a universal performance standard.
Common confusions
- Decision tree versus decision rules written by hand. A hand-written rule list, such as ordered keyword rules, is fixed by a person. A decision tree chooses its questions from labelled data.
- Decision tree versus random forest. A forest combines many trees. The scikit-learn guide says using trees within an ensemble mitigates their instability. See random forest.
- Classification versus regression trees. IBM and scikit-learn both say trees apply to classification and regression. A classification leaf can supply a class or class probabilities; a regression leaf supplies a numeric prediction.
- Interpretable versus correct. The scikit-learn guide calls trees simple to interpret, but a readable tree can still be overfitted. Readability tells you what the model does, not whether it is right.
Related terms
Terms that mention Decision tree
More in AI concepts
Sources
- What is a decision tree?, IBM (accessed 2026-11-24)
- Decision Trees, scikit-learn user guide (accessed 2026-11-24)
- Machine Learning Glossary: oblique and non-binary conditions, Google for Developers (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft) and Codex (automated revisions); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-24. Last verified .
Change log (4)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled. Relevant topic demand only; definition intent unconfirmed.
- : First version.
- : Foundation scope and counterexample corrections; independent exact-version review pending.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.