AI glossary

Decision tree

In one sentence A decision tree predicts by asking a sequence of yes/no questions about the features, like a flowchart learned from data.

By Updated

A decision tree is a model that predicts by walking a flowchart of yes/no questions, where the questions were learned from data.

A doctor doing triage works this way. Fever above 102? If yes, rash present? If no, recent travel? Each answer narrows the possibilities until a decision falls out. A decision tree builds that flowchart automatically: at each node it picks the feature and threshold that best separate the classes, splits the data, and repeats inside each branch.

                 income > ₹50,000?
                 /              \
              yes                no
         owns home?          defaulted before?
          /      \             /         \
       approve   review     reject      review

Trees are the most explainable mainstream model — you can print the rules and hand them to an auditor, and scikit-learn will draw the tree for you. They need no feature-scaling, handle numbers and categories together, and capture interactions between features naturally.

Their weakness is drastic overfitting: grown deep enough, a tree memorises the training set, one leaf per example, and small data changes produce a completely different tree. Pruning and depth limits help, but the real cure was discovered elsewhere — average many diverse trees. That gives the random-forest; building trees sequentially, each fixing the last one's errors, gives gradient-boosting. Single trees explain; ensembles of trees win.

Where to go next