A decision tree is a machine learning model that makes predictions by asking a series of simple yes-or-no questions about the input data, structured like a flowchart, until it arrives at a final answer.

How a Tree Is Built

Starting from a root node containing all the training data, the algorithm searches for the question that best splits the data into groups that are as pure as possible, meaning each resulting group leans strongly toward one outcome. This splitting process repeats at each new branch, creating deeper levels of questions, until the branches reach a stopping point, such as a maximum depth or a minimum group size.

Strengths and Weaknesses

Because a single tree can be unstable, practitioners often combine many trees together into an ensemble, such as a random forest or a gradient boosted tree model, which trades away some interpretability in exchange for noticeably better and more reliable accuracy.