20.22 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.480277e-01      0 1.0000000 1.0000000 0.004216953
## 2  3.662309e-02      1 0.8519723 0.8476371 0.003961401
## 3  3.395877e-02      2 0.8153492 0.8260968 0.003921640
## 4  4.956084e-03      3 0.7813904 0.7864707 0.003845910
## 5  3.289003e-03      5 0.7714782 0.7662625 0.003805948
## 22 5.117900e-04     46 0.7116891 0.7257784 0.003723019
## 23 5.080268e-04     49 0.7101538 0.7257558 0.003722971
## 24 4.967373e-04     53 0.7081217 0.7257558 0.003722971
## 25 4.402899e-04     54 0.7076249 0.7247398 0.003720839
## 26 4.177109e-04     58 0.7058638 0.7237915 0.003718847
## 27 4.064215e-04     60 0.7050283 0.7232947 0.003717802
## 28 3.838425e-04     61 0.7046219 0.7223690 0.003715854
## 29 3.725530e-04     65 0.7030414 0.7223464 0.003715806
## 80 7.338165e-05    915 0.5910271 0.7226174 0.003716377
## 81 6.773691e-05    929 0.5898756 0.7228883 0.003716947
## 82 6.397375e-05   1180 0.5716092 0.7248301 0.003721029
## 83 6.322112e-05   1196 0.5705706 0.7258236 0.003723113

%$

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 availability and give you access to the PDF version of this 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-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0