21.23 Complexity Parameter Table

We can look at the raw data to have a more precise and detailed view of the data. Here we only list specific rows from the complexity parameter table.

tmodel$cptable[c(1:5,22:29, 80:83),]
##              CP nsplit rel error    xerror        xstd
## 1  1.430060e-01      0 1.0000000 1.0000000 0.004425164
## 2  3.864758e-02      1 0.8569940 0.8548111 0.004169808
## 3  3.403369e-02      2 0.8183464 0.8233324 0.004108819
## 4  5.134820e-03      3 0.7843128 0.7867933 0.004035262
## 5  5.029395e-03      5 0.7740431 0.7808895 0.004023089
## 22 4.878492e-04     45 0.7151539 0.7306328 0.003916044
## 23 4.465061e-04     48 0.7136904 0.7284747 0.003911306
## 24 4.341031e-04     54 0.7106641 0.7267383 0.003907485
## 25 4.217002e-04     59 0.7084067 0.7265646 0.003907103
## 26 4.092972e-04     61 0.7075633 0.7265150 0.003906994
## 27 3.968943e-04     63 0.7067447 0.7258949 0.003905627
## 28 3.844914e-04     64 0.7063478 0.7258949 0.003905627
## 29 3.720884e-04     66 0.7055788 0.7255228 0.003904806
## 80 6.945650e-05   1020 0.5779525 0.7313522 0.003917621
## 81 6.821621e-05   1027 0.5774564 0.7357924 0.003927323
## 82 6.733028e-05   1074 0.5736115 0.7357924 0.003927323
## 83 6.614905e-05   1084 0.5728425 0.7361893 0.003928188

%$

See how the relative error continues to decrease as the tree becomes more complex, but the cross validated error decreases and then starts to increase! We might choose a sensible value of from this table.



Your donation will support ongoing development and give you access to the PDF version of the book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.