Forgive me if I misunderstand your goals but I have no idea what you are trying to determine or what your data is. I can say, however, that setting mindev to 0 has always overfit data for me, and that you are more than likely looking at a situation in which that 1 node tree is more accurate.
Also, if you look at ?cv.tree, the default function to use is prune.tree(). Perhaps prune.tree() is trimming down to that terminal node? If you want an alternative look at CART methods that may account for some of your issues, I would recommend the packages 'rpart' and 'party', as they may be more informative. -------------------------------------- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it." - Jubal Early, Firefly From: Shiyao Liu <lsy...@iastate.edu> To: r-help@r-project.org Date: 11/03/2010 09:04 PM Subject: [R] cross-validation for choosing regression trees Sent by: r-help-boun...@r-project.org Dear All, We came across a problem when using the "tree" package to analyze our data set. First, in the "tree" function, if we use the default value "mindev=0.01", the resulting regression tree has a single node. So, we set "mindev=0", and obtain a tree with 931 terminal nodes. However, when we further use the "cv.tree" function to run a 10-fold cross-validation, the error message is: "Error in prune.tree(list(frame = list(var = 1L, n = 6676, dev = 3.28220789569792, : can not prune singlenode tree". Is the "cv.tree" function respecting the mindev chosen in the tree function or what else might be wrong? Thanks, Shiyao [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.