Skip to content

Decision Trees

For people

How decision trees split data with simple questions, why they are easy to explain, and why single trees overfit.

Editorial team 2 min read

Share X LinkedIn Reddit Bluesky Email

A decision tree predicts by asking a series of yes/no questions about the features, like a flowchart.

How a Tree Is Built

Starting with all the training data, the algorithm picks the feature and threshold that best separates the outcomes — for example, income < 40,000. It splits the data into two groups and repeats the process within each group, until a stopping rule is reached. Each final group, a leaf, predicts the most common class or the average value of its examples.

"Best" split is measured with criteria such as Gini impurity or entropy for classification and variance reduction for regression.

Strengths

  • Easy to visualise and explain.
  • Handle numeric and categorical features and non-linear relationships.
  • Need little data preparation — no scaling required.

Weaknesses

  • A deep tree overfits easily, memorising noise.
  • Small changes in data can produce a very different tree (high variance).
  • Predictions are step-like rather than smooth.

Controlling Overfitting

Limit max_depth, require a minimum number of samples per leaf, or prune the tree after growing it.

Where Trees Really Shine

Combined into ensembles — random forests and gradient boosting — trees become some of the most accurate models for tabular data. A single shallow tree remains valuable for explanation and quick insight.

More in Machine learning

All Machine learning guides →
Machine learning Guide · 2 min

Linear Regression Explained

The simplest predictive model: how linear regression fits a line through data, how to read its coefficients, and when it breaks down.

Machine learning 2 min read 25 Sep 2026 For people

Machine learning Guide · 2 min

Logistic Regression for Classification

Despite its name, logistic regression is a classification method. How it produces probabilities and why it remains a strong baseline.

Machine learning 2 min read 24 Sep 2026 For people

Machine learning Guide · 2 min

Random Forests

Why averaging many randomised decision trees produces a robust, accurate model with little tuning.

Machine learning 2 min read 22 Sep 2026 For people

Machine learning Guide · 2 min

Gradient Boosting

How gradient boosting builds trees that correct each other's mistakes, and why it dominates tabular machine learning.

Machine learning 2 min read 21 Sep 2026 For people

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in