Skip to content
— CH. 1 · INTRODUCTION —

Alternating decision tree

~4 min read · Ch. 1 of 7
7 sections
  • An alternating decision tree, or ADTree, classifies a new piece of data not by following a single path through a tree but by following every path simultaneously. That single departure from how most people picture a decision tree turns out to be the key to understanding what makes ADTrees unusual. When you feed an email into an ADTree trained to detect spam, the algorithm doesn't branch once and stop. It traces every route where the decision conditions hold true, collects numbers from the prediction nodes along the way, and adds them up. The sign of that final sum tells you the answer. That arithmetic simplicity hides a deeper question: where does the tree come from in the first place, and why does its structure matter for understanding how spam differs from ordinary email?

  • Yoav Freund and Llew Mason introduced ADTrees as an extension of earlier boosting research. The original publication contained several typographical errors, which prompted a follow-up effort. Bernhard Pfahringer, Geoffrey Holmes, and Richard Kirkby later published clarifications and optimizations that made the algorithm more precise and practically usable. Implementations of those corrected versions became available in two software packages: Weka and JBoost. The JBoost implementation in particular figures prominently in the worked example the original authors provided, using a publicly available dataset from the UCI Machine Learning Repository called the spambase dataset.

  • Before ADTrees, researchers working on boosting would typically combine large numbers of very simple classifiers called decision stumps. Each stump tests exactly one attribute against one threshold. After many iterations, a boosted system produces a collection of weighted stumps that vote on the final classification. That approach works, but the resulting set of hypotheses has no inherent organization. Looking at a pile of weighted stumps, you cannot easily tell which attributes interact or which conditions reinforce each other. ADTrees address this directly. Each new hypothesis must attach to a hypothesis from an earlier iteration, creating a parent-child relationship across the set. The result can be drawn as a tree, and that tree makes correlations between attributes readable in a way a flat list never could.

  • At each iteration of the algorithm, two things happen: a new precondition and a new condition are chosen, and two new scores are computed and attached. The set of rules therefore grows by two preconditions per iteration. A rule consists of a precondition, which is a logical conjunction of earlier conditions, and a condition, which takes the form "attribute compared to value." Evaluating a rule runs a pair of nested if-statements: if the precondition holds and the condition holds, return the first score; if the precondition holds but the condition does not, return the second score; otherwise return zero. The data itself changes shape as the process runs. Instances the current model misclassifies receive larger weights in the next iteration, while correctly classified instances receive smaller weights, nudging each successive rule toward the errors the previous ones made.

  • A worked example from the spambase dataset shows the arithmetic in action. One instance in the example has a char_freq_bang value of 0.08, a word_freq_hp value of 0.4, and a word_freq_remove value of 0.9, among other features. Running that instance through a seven-iteration ADTree built with JBoost yields individual prediction node values of -0.093, 0.74, -1.446, -0.38, 0.176, 0, and 1.66. Summing those gives a final score of 0.657. Because that number is positive, and spam was coded as 1 in this dataset, the instance is classified as spam. The magnitude of the score also carries meaning: a number close to zero signals low confidence, while a large positive or negative value signals high confidence.

  • The original authors identified three distinct ways a practitioner can read an ADTree after training. At the finest level, individual prediction nodes can be assessed for their standalone predictive power. At a middle level, nodes sharing a path through the tree can be treated as representing a joint effect between attributes. At the broadest level, the entire tree can be read as a unified classifier. One important caveat accompanies the first level: individual node scores reflect the re-weighted distribution of data at the iteration when that node was added, not the original distribution. A node's score can therefore be misleading if read as a simple measure of raw attribute importance. The tree as a whole absorbs those interactions; individual nodes do not stand alone.

  • Figure 6 in the original paper compared ADTrees against boosted decision trees and boosted decision stumps across several datasets. ADTrees proved typically as robust as both competitors in terms of accuracy. The more notable finding was structural: equivalent accuracy was achievable with a simpler tree than what recursive partitioning algorithms like CART or C4.5 would produce. The key distinction from those binary trees is that a given instance follows only one path through a CART or C4.5 tree, while an ADTree instance follows all paths where the decision conditions hold. That multi-path scoring is what allows ADTrees to pack predictive power into fewer nodes, and it connects back to the JBoost spambase example, where seven iterations were enough to produce a classifiable score.

Common questions

What is an alternating decision tree (ADTree) in machine learning?

An alternating decision tree is a machine learning method for classification that generalizes decision trees and connects to boosting. It consists of alternating decision nodes, which specify a predicate condition, and prediction nodes, which contain a single number. An instance is classified by following all paths where decision nodes are true and summing the prediction nodes traversed.

Who invented the alternating decision tree algorithm?

ADTrees were introduced by Yoav Freund and Llew Mason. The original publication contained typographical errors, and later clarifications and optimizations were provided by Bernhard Pfahringer, Geoffrey Holmes, and Richard Kirkby.

How does an alternating decision tree differ from CART or C4.5?

In binary classification trees like CART and C4.5, an instance follows only one path through the tree. In an ADTree, an instance follows all paths for which all decision nodes are true, and the final classification is the sum of prediction node values along those paths.

Where are ADTree implementations available?

Implementations of the alternating decision tree algorithm are available in Weka and JBoost.

How does the ADTree algorithm handle misclassified instances during training?

Instances that are misclassified during training are given a larger weight in the next iteration, while accurately classified instances receive reduced weight. This re-weighting focuses successive rules on the examples the current model gets wrong.

How do you interpret the final score produced by an alternating decision tree?

The sign of the final summed score determines the classification, while the magnitude indicates confidence in the prediction. The original authors also identify three levels of interpretation: individual nodes, sets of nodes on a shared path, and the tree as a whole.

All sources

4 references cited across the entry

  1. 2bookAdvances in Knowledge Discovery and Data Mining. PAKDD 2001Bernhard Pfahringer et al. — Springer — 2001
  2. 4webUCI Machine Learning RepositoryD. Dua et al. — University of California, Irvine, School of Information and Computer Sciences — 2019