8 0.0157908 7 0.29809 0.030863 9 0.0094604 9 0.27080 0.028558 10 0.0054766 10 0.13762 0.24297 0.026055 within 1 SE (xstd) of min 11 0.0052307 11 0.24232 0.026039 12 0.0043985 12 0.23530 0.025449 13 0.0022883 13 0.12252 0.23783 0.025427 14 0.0022704 14 0.12023 0.23683 0.025407 15 0.0014131 15 0.11796 0.23703 0.025453 16 0.0010000 16 0.11655 0.23455 0.025286 > plotcp(cpus.tree) > plot(cpus.tree,uniform=T) > text(cpus.tree,cex=.7) Prune the tree back to a 10 split, 11 terminal node tree using cp = .0055. > cpus.tree = rpart(log(Performance)~.,data=cpus[,2:7],cp=.0055) > post(cpus.tree) > plot(log(Performance),predict(cpus.tree),ylab="Fitted Values",main="Fitted Values vs. log(Performance)") > abline(0,1) > plot(predict(cpus.tree),resid(cpus.tree),xlab="Residuals", ylab="Fitted Values",main="Residuals vs. Fitted (cpus.tree)") > abline(h=0) Bagging for Regression Trees Suppose we are interested in predicting a numeric response variable and For example, , might come from an OLS model selected using Mallow’s with all potential predictors or from a CART model using with a complexity parameter x cp = Letting denote , where the expectation is with respect to the distribution .005. underlying the training sample (since, viewed as a random variable, is a function of training sample, which can be viewed as a high-dimensional random variable) and not (which is considered fixed), we have that:
8 0.0157908 7 0.29809 0.030863 9 0.0094604 9 0.27080 0.028558 10 0.0054766 10 0.13762 0.24297 0.026055 within 1 SE (xstd) of min 11 0.0052307 11 0.24232 0.026039 12 0.0043985 12 0.23530 0.025449 13 0.0022883 13 0.12252 0.23783 0.025427 14 0.0022704 14 0.12023 0.23683 0.025407 15 0.0014131 15 0.11796 0.23703 0.025453 16 0.0010000 16 0.11655 0.23455 0.025286 > plotcp(cpus.tree) > plot(cpus.tree,uniform=T) > text(cpus.tree,cex=.7) Prune the tree back to a 10 split, 11 terminal node tree using cp = .0055. > cpus.tree = rpart(log(Performance)~.,data=cpus[,2:7],cp=.0055) > post(cpus.tree) > plot(log(Performance),predict(cpus.tree),ylab="Fitted Values",main="Fitted Values vs. log(Performance)") > abline(0,1) > plot(predict(cpus.tree),resid(cpus.tree),xlab="Residuals", ylab="Fitted Values",main="Residuals vs. Fitted (cpus.tree)") > abline(h=0) Bagging for Regression Trees Suppose we are interested in predicting a numeric response variable and For example, , might come from an OLS model selected using Mallow’s with all potential predictors or from a CART model using x with a complexity parameter cp = .005. Letting denote , where the expectation is with respect to the distribution underlying the training sample (since, viewed as a random variable, is a function of training sample, which can be viewed as a high-dimensional random variable) and not (which is considered fixed), we have that:
Classification%20and%20Regression%20Trees.docx