Methods and formulas for the confusion matrix in CART® Classification

Select the method or formula of your choice.

The Confusion matrix is not present when the splitting method is class probability.

Count

When there are no weights, the counts and the sample sizes are the same.

Weighted count

In the weighted case, the weighted count is the sum of the weights for a category. Weighted counts round to the nearest whole number. Use the unrounded weights to calculate percentages and rates. Consider the following simple example:
Response level Predicted level Weight
Yes Yes 0.1
Yes Yes 0.2
Yes No 0.3
Yes No 0.4
No No 0.5
No No 0.6
No Yes 0.7
No Yes 0.8
This table provides the following statistics:
Actual class Weighted count Predicted class = Yes Predicted Class = No Percent correct
Yes 0.1 + 0.2 + 0.3 + 0.4 = 1 0.1 + 0.2 = 0.3 ≈ 0 0.3 + 0.4 = 0.7 ≈ 1 0.3 / (0.3 + 0.7) ×100 = 30%
No 0.5 + 0.6 + 0.7 + 0.8 = 2.6 ≈ 3 0.7 + 0.8 = 1.5 ≈ 2 0.5 + 0.6 = 1.1 ≈ 1 1.1 / (1.5 + 1.1) × 100 = 42.31%
All 1 + 2.6 = 3.6 ≈ 4 0.3 + 1.5 = 1.8 ≈ 2 0.7 + 1.1 = 1.8 ≈ 2 (0.3 + 1.1) / 3.6 × 100 = 38.89%

True positive rate (sensitivity or power)

False positive rate (type I error)

False negative rate (type II error)

True negative rate (specificity)