From a Terminal Node to a Class Label
A classification tree can describe a terminal node in two complementary ways. It can report the estimated proportion of observations in each class, or it can give a single predicted class label. The proportions retain information about uncertainty and the mix of classes in the node; the label is a compact decision for an observation that falls there. Converting the proportions to a label is straightforward when one class has the largest proportion, but requires care when the largest value is tied or when displayed rounding hides a small difference.
Suppose a terminal node contains observations from \(K\) possible classes. Let \(n_k\) be the number in class \(k\), and let \(n=\sum_{k=1}^{K}n_k\) be the total number in the node. The estimated class proportion is \(\hat{p}_k=n_k/n\). If proportions are provided directly, they play the same role; apart from rounding, they should be nonnegative and sum to one.
The set notation \(\operatorname*{arg\,max}\) matters: it means the set of classes attaining the maximum, not the maximum proportion itself. For example, if the proportions are \(0.50, 0.30, 0.20\), the first class is the unique maximizer. If they are \(0.45, 0.45, 0.10\), both of the first two classes maximize the proportion. The latter case does not, by itself, specify which single label software or an analyst must output.
Why the Largest Proportion Is the Majority-Class Prediction
The majority-class rule has a direct decision-theoretic justification when every incorrect classification has the same cost and a correct classification has zero cost. Conditional on an observation belonging to the node, suppose the probability of class \(k\) is estimated by \(\hat{p}_k\). If we predict class \(j\), the estimated probability of an error is the probability that the true class is anything other than \(j\).
The total proportion is one, so increasing \(\hat{p}_j\) decreases \(1-\hat{p}_j\). Therefore, a class with the largest estimated proportion minimizes the estimated probability of misclassification among single-label predictions. If several classes share the largest proportion, each gives the same minimum error probability. This is why a separate convention can select among tied labels without changing that minimum.
Identify the classes and their counts or estimated proportions. Confirm which observations belong to this terminal node.
If counts are supplied, compare counts directly when they share a denominator; otherwise calculate the proportions. Do not decide a tie from rounded display values alone.
A unique maximum determines the label. For an exact tie, use the stated priority or other specified convention.
The selected label is a summary decision. It does not replace, alter, or make equal the underlying class-proportion estimates.
Worked Examples
Worked Example: Selecting the Unique Majority Class
A hypothetical insurer classifies reported equipment claims into three causes. A terminal node contains 24 claims: 13 hail claims, 8 wind claims, and 3 flood claims. Find the estimated class proportions and the node’s majority-class prediction.
Method. Divide each class count by the total number of claims in the node. Since all proportions have the same denominator, comparing the counts also identifies the largest proportion.
Hail: \(13/24=0.5417\) to four decimal places. Wind: \(8/24=0.3333\). Flood: \(3/24=0.1250\).
Check the proportions: \(0.5417+0.3333+0.1250=1.0000\) using the displayed rounded values. The unrounded fractions also sum exactly to \((13+8+3)/24=1\).
Hail has the largest count and proportion, so the predicted label is hail. The estimated probability associated with hail remains \(13/24\); reporting “hail” as the label does not mean the node is certain to contain a hail claim.
Common mistake avoided: Choosing the label based on the class name or the order in which classes are listed. The label follows from the largest proportion, not its position in a table.
Worked Example: Resolving an Exact Tie by a Stated Priority
A hypothetical service team assigns each case in a terminal node to one of three resolution types. The node contains 20 cases: 9 routine resolutions, 9 specialist resolutions, and 2 escalations. The team’s documented tie priority is specialist first, routine second, escalation third. Find the proportions and the predicted label.
Step 1: Calculate the proportions. Routine is \(9/20=0.45\), specialist is \(9/20=0.45\), and escalation is \(2/20=0.10\). They sum to \(0.45+0.45+0.10=1.00\).
Step 2: Identify the maximum. The largest proportion is \(0.45\), attained by both routine and specialist. The node therefore has an exact tie for the majority class; neither tied class has a larger estimated proportion.
Step 3: Apply the specified convention. The priority order selects specialist ahead of routine. The predicted label is therefore specialist.
Check what the tie rule did. The estimated proportions are still \(0.45, 0.45,\) and \(0.10\). The convention selects one output label; it does not convert the specialist proportion to a value greater than \(0.45\), nor does it remove the routine proportion.
Common mistake avoided: Calling specialist the statistically larger class after applying the priority. It is the selected label under the stated convention, but the two class-proportion estimates remain equal.
Worked Example: A Tie Created by Rounding Is Not an Exact Tie
A hypothetical quality-control tree sends 201 inspected components to a terminal node. Of these, 101 are classified as acceptable and 100 as requiring repair. A report rounds proportions to two decimal places. Determine the predicted label and explain how to interpret the report.
Step 1: Calculate the proportions from the counts. The acceptable proportion is \(101/201=0.5025\) to four decimal places. The repair proportion is \(100/201=0.4975\) to four decimal places.
Step 2: Check the node total. The exact proportions sum to \((101+100)/201=201/201=1\). Their four-decimal displays also sum to \(0.5025+0.4975=1.0000\).
Step 3: Compare before rounding for display. The acceptable proportion is larger because \(101>100\) and both counts use the same denominator. Thus the predicted label is acceptable.
Step 4: Interpret the two-decimal report. Both proportions round to \(0.50\) to two decimal places. That display makes them appear tied, but the underlying counts are not equal. The rounded report has lost the small distinction needed to identify the majority.
Common mistake avoided: Applying an exact-tie convention to values that are only equal after rounding. Use the unrounded values or original counts when available; round only for presentation.
Tie Conventions and Interpretation
A tie convention is a rule for selecting a label when the estimated maximum is attained by more than one class. It should be stated clearly and applied consistently. A fixed class priority is one simple convention. Another explicitly stated procedure might use a broader node-level or training-set summary to choose among tied classes. Such a procedure is a convention for the final label, not a recalculation of the proportions in the terminal node.
A deterministic rule is useful when results need to be reproducible: the same node information then yields the same predicted label. If no tie rule is specified, the mathematically complete answer is to report all classes attaining the maximum and state that the single-label prediction depends on the convention used. Do not silently assume that alphabetical order, table order, or software-specific behavior is universal.
Keep three statements distinct when interpreting a node: its estimated class proportions, the class or classes that maximize those proportions, and the single label selected after any tie convention. For instance, proportions of \(0.40, 0.40,\) and \(0.20\) describe a tie for the maximum. A rule that selects the second class produces that class as the output label, but does not make its estimated proportion \(0.60\) or imply that the first class has probability zero.
The justification above depends on equal costs for all misclassifications: predicting \(j\) has estimated error probability \(1-\hat{p}_j\). If different errors have different consequences, minimizing the probability of any error need not be the desired decision rule. The majority-class rule should therefore be understood as the single-label rule for the equal-cost setting, rather than as a universal decision rule for every application.
Common Mistakes to Avoid
- Confusing proportions with labels. A node’s proportion vector gives more information than its single predicted label. Report or interpret both when the question asks for both.
- Using a tie rule when there is a unique maximum. A convention is needed only when multiple classes have the same largest value at the precision of the underlying estimates.
- Treating rounded equality as exact equality. Compare original counts or unrounded estimates if they are available.
- Changing the probabilities to justify the selected label. A priority rule chooses among maximizers; it does not change any class-proportion estimate.
- Leaving the tie convention implicit. If a problem gives a priority, follow it. If it gives none, state the tied classes rather than inventing a universal rule.
Check Your Understanding
For each problem, identify the relevant proportions, use any stated tie convention, and distinguish exact ties from display rounding.
- A terminal node contains 16 hypothetical service requests: 7 resolved online, 6 resolved by phone, and 3 referred to a specialist. Find the proportions and predicted label. (Answer: online; proportions \(7/16=0.4375\), \(6/16=0.3750\), and \(3/16=0.1875\).)
- A node contains 12 hypothetical sensor alerts: 5 signal a low reading, 5 signal a high reading, and 2 signal a fault. The stated priority for ties is high reading, then fault, then low reading. What label is selected, and what are the proportions? (Answer: high reading; the proportions are \(5/12, 5/12,\) and \(2/12\), so low and high are tied and the priority selects high.)
- A terminal node contains 201 hypothetical transactions: 101 are routine and 100 are flagged. A report displays both proportions to two decimals. Does the displayed equality establish an exact tie, and which label is predicted? (Answer: No; the proportions are \(101/201\approx0.5025\) and \(100/201\approx0.4975\), so routine is the unique majority label, although both display as \(0.50\).)
- A hypothetical node contains 30 applications: 12 approved, 12 deferred, and 6 declined. If the stated tie rule is to use the larger overall training-set count among tied classes, and the overall counts are 40 approved, 45 deferred, and 15 declined, what is the selected label? State the node proportions too. (Answer: deferred; the node proportions are \(0.40, 0.40,\) and \(0.20\), and the overall-count convention selects deferred from the tied node classes.)
- A node’s estimated proportions are 0.28 for bronze, 0.36 for silver, and 0.36 for gold. The stated tie priority is gold, then silver, then bronze. Give the predicted label and explain whether its estimated proportion changes. (Answer: gold; it is selected from the exact tie, while the proportions remain \(0.28, 0.36,\) and \(0.36\).)