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.
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
Learn it in a course
Sources and further reading
Other terms from ML Models & Algorithms
- BERT (Bidirectional Encoder Representations from Transformers)Google's 2018 transformer language model that reads text in both directions to produce context-aware embedding…
- BERTopicA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-ba…
- BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies)BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clusters very large numeric datasets by s…
- BM25A classic ranking function that scores documents by how often query words appear, adjusted for word rarity and…
- Boyer-MooreA fast exact string-search algorithm that compares a pattern from right to left and skips ahead after mismatch…
- c-TF-IDFClass-based TF-IDF: treats each cluster as one document to find the words that best describe it, used by BERTo…
- Centroid-based ClusteringA clustering family that groups data around central points (centroids), each the average of its cluster's memb…
- Convolutional Neural Network (CNN)A deep learning architecture that scans data with small learned filters to detect local patterns; the classic…
- DBSCANDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels iso…

