Generalization Error Decision Tree
Contents |
Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Cross Validated classification error rate decision tree Questions Tags Users Badges Unanswered Ask Question _ Cross Validated is a question and answer site for
Training Error Decision Tree
people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute: Sign up Here's how it works: classification error in r Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top trouble in computing generalization error rate of the decision tree up vote 1 down vote favorite 1 This is a picture from the book introduction decision tree error rate to data mining. I cannot understand this decision tree. Why the label in leaf node where A=1 && C=0 is '+' instead of '-'. From the table, it is clearly that there are 3 '-' and 2 '+'. Besides, I think that generalization error rate equals (0 + 1 + 2 + 1) / 10 = 0.4. Is it correct? Thanks. classification data-mining share|improve this question asked May 14 at 13:30 Mark 306 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted
Classification Error Machine Learning
I would guess that this is either part of the exercise (i.e., to figure out that the tree is not optimal) or a typo (i.e., the labels should be -/+ rather than +/- after the split in C). To be able to play around with the data more easily I encoded the tree in R using the partykit package. First, I set up the tree as shown in Figure 4.30. Then I turn the tree into a constant-fit tree(a constparty object) where the predictions in each leaf are re-computed based on the observed responses. Finally, I obtain the confusion matrices on the training and validation data, respectively. The complete data is: Exercise8 <- data.frame( A = factor(c(0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1)), B = factor(c(0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0)), C = factor(c(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)), Class = factor(c("+", "+", "+", "-", "+", "+", "-", "+", "-", "-", "+", "+", "+", "-", "+")) ) This can be split up into training and validation data: Training <- Exercise8[1:10, ] Validation <- Exercise8[11:15, ] Then we set up the tree as shown in the picture library("partykit") Tree <- party( partynode(1L, split = partysplit(varid = 1L, index = 1:2), kids = list( partynode(2L, split = partysplit(varid = 2L, index = 1:2), kids = list( partynode(3L, info = "+"), partynode(4L, info = "-"))), partynode(5L, split = partysplit(varid = 3L, index = 1:2), kids = list( partynod
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 17 Oct 2016 04:38:41 GMT by s_ac15 (squid/3.5.20)
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 17 Oct 2016 04:38:41 GMT by s_ac15 (squid/3.5.20)