Skip to content

ML Models & Algorithms

Decision Tree

In shortA supervised model that predicts by asking a series of yes/no questions about the data, branching like a flowchart until it reaches an answer.

Updated 24 Oct 2026· 2 min read

A decision tree is a supervised machine learning model that makes predictions by asking a series of simple questions about an item’s features. Each answer sends the item down a branch until it reaches a leaf, which holds the prediction. Decision trees handle both classification and regression, and because you can read the tree like a flowchart, they are one of the easiest models to explain to stakeholders.

How it works

Training starts with all labelled examples at the root. The algorithm tests possible questions (“is word count above 1,200?”) and picks the split that separates the classes most cleanly, measured by Gini impurity or information gain (the drop in entropy after the split). It repeats this on each branch until a stopping rule is met, such as a maximum depth or a minimum number of examples per leaf.

Single trees are the building block for stronger ensembles: random forests average many trees trained on different samples, and gradient-boosted trees add trees one at a time to fix earlier mistakes.

How it’s used in SEO and marketing

  • Page categorisation. Sort URLs into blog, product, category or support pages from on-page features.
  • Schema suggestions. MLforSEO’s classification guide describes classifying pages as Product, FAQ or Event to score structured data opportunities, using decision trees or AutoML.
  • Explaining a metric. Fit a shallow tree to see which features best split high-CTR pages from low-CTR ones.
  • Segmentation and churn. Classic marketing uses include customer segments and churn risk.

The idea also sits behind a modern search concept: MLforSEO’s information gain explainer traces the term back to how decision trees choose their splits.

Example

To classify pages by type, a tree might learn: does the URL contain “/product/”? If yes, does the page show a price? If yes, label it Product. If the URL has no “/product/” but has a publish date and author byline, label it Article. Each rule is visible, so you can check it against your site and fix the training data where it goes wrong.

Limitations and things to watch

  • Deep trees overfit, memorising training data and failing on new pages. Limit depth and test on held-out data.
  • They are unstable: small changes in the data can produce a very different tree.
  • A single tree is usually less accurate than a random forest or boosted model.
  • Like all supervised methods, it needs labelled examples, and its rules are only as sound as those labels.

Learn it on MLforSEO

Where Decision Tree shows up on MLforSEO

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →