20.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.690000e-01      0 1.0000000 1.0000000 0.004003739
## 2  2.704940e-02      1 0.8310000 0.8360073 0.003742385
## 3  3.801427e-03      3 0.7769012 0.7782501 0.003638129
## 4  3.535735e-03      5 0.7692984 0.7612050 0.003606007
## 5  3.453984e-03     10 0.7458971 0.7601627 0.003604022
## 22 4.189744e-04     61 0.7008931 0.7153222 0.003516271
## 23 4.019430e-04     63 0.7000552 0.7148113 0.003515244
## 24 3.883178e-04     66 0.6988494 0.7148930 0.003515408
## 25 3.780989e-04     70 0.6972961 0.7145864 0.003514792
## 26 3.678800e-04     72 0.6965399 0.7144025 0.003514422
## 27 3.474422e-04     73 0.6961720 0.7141981 0.003514011
## 28 3.372233e-04     77 0.6947822 0.7144229 0.003514463
## 29 3.270044e-04     80 0.6934742 0.7139529 0.003513517
## 80 6.715270e-05    967 0.5876678 0.7176521 0.003520946
## 81 6.688727e-05    985 0.5863394 0.7176521 0.003520946
## 82 6.540089e-05   1009 0.5845204 0.7176521 0.003520946
## 83 6.471963e-05   1019 0.5838664 0.7176521 0.003520946

%$

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