similar to: cross-validation in rpart

Displaying 20 results from an estimated 2000 matches similar to: "cross-validation in rpart"

2009 Jun 09
3
rpart - the xval argument in rpart.control and in xpred.rpart
Dear R users, I'm working with the rpart package and want to evaluate the performance of user defined split functions. I have some problems in understanding the meaning of the xval argument in the two functions rpart.control and xpred.rpart. In the former it is defined as the number of cross-validations while in the latter it is defined as the number of cross-validation groups. If I am
2008 Jul 03
1
cross-validation in rpart
Hello list, I'm having a problem with custom functions in rpart, and before I tear my hair out trying to fix it, I want to make sure it's actually a problem. It seems that, when you write custom functions for rpart (init, split and eval) then rpart no longer cross-validates the resulting tree to return errors. A simple test is to use the usersplits.R function to get a simple, custom
2012 Dec 07
0
loop for calculating 1-se in rpart
Hi Listers I need to calculate and then plot a frequency histogram of the best tree calculated using the 1-se rule. I have included some code that has worked well for me in the past but it was only for selecting the minimum cross-validation error. I include the code for my model, some relevant output and the code for selecting and plotting the frequency histogram of minimum xerror. Here is the
2009 May 21
1
Rpart - best split selection for class method and Gini splitting index
Dear R-users, I'm working with the Rpart package and trying to understand how the procedure select the best split in the case the method "class" and the splitting index "Gini" are used. In particular I'd like to have look to the source code that works out the best split for un unordered predictor. Does anyone can suggest me which functions in the sources I should
2009 May 14
0
Rpart - user defined split functions
Dear all, I'm writing my own method to be used in Rpart by defining the list of functions named init, split and eval. I'm following the example given in the file 'tests/usersplits.R' in the sources. By now I'm able to define the split function (and it works correctly in the tree construction) while I have some problems with the init and the eval function. The task I'm
2003 Sep 29
1
CP for rpart
Hi All, I have some questions on using library rpart. Given my data below, the plotcp gives me increasing 'xerrors' across different cp's with huge xstd (plot attached). What causes the problem or it's not a problem at all? I am thinking 'xerror's should be decreasing when 'cp' gets smaller. Also what the 'xstd' really tells us? If the error bars for
2001 Nov 14
3
rpart:plotcp doesn't allow ylim argument (PR#1171)
Full_Name: Gregory R. Warnes Version: R 1.3.1 OS: Solaris 2.8 Submission from: (NULL) (192.77.198.200) rpart library version 3.1-2 Error message: > plotcp(fit.thirds.1,ylim=c(0.7,1.5)); Error in plot.default(ns, xerror, axes = FALSE, xlab = "cp", ylab = "X-val Relative Error", : formal argument "ylim" matched by multiple actual arguments > This can be
2009 Jun 04
0
ordered Twoing criterion in classification trees
Dear R users, I'm using the rpart package to build classification trees. I'm interested in implementing the ordered Twoing as a splitting criterion. Does anyone have experience with this task ? Thank you for your help Paolo Paolo Radaelli Dipartimento di Metodi Quantitativi per le Scienze Economiche ed Aziendali Facolt? di Economia Universit? degli Studi di Milano-Bicocca Via Bicocca
2008 Mar 01
1
model R^2 and partial R^2 values
Dear R-list members, I am doing a CART analysis in R using the rpart function in the rpart package: Phrag.rpart=rpart(PhragDiff~., data = Phrag, method="anova", xval=10). I used the xerror values in the CP table to prune the tree to 4 nsplits: CP nsplit rel error xerror xstd 1 0.098172 0 1.00000 1.02867 0.12768 2 0.055991 3 0.70548 1.00823 0.12911 3
2010 Oct 12
2
repeating an analysis
Hi All, I have to say upfront that I am a complete neophyte when it comes to programming. Nevertheless I enjoy the challenge of using R because of its incredible statistical resources. My problem is this .........I am running a regression tree analysis using "rpart" and I need to run the calculation repeatedly (say n=50 times) to obtain a distribution of results from which I will pick
2011 Dec 31
1
Cross-validation error with tune and with rpart
Hello list, I'm trying to generate classifiers for a certain task using several methods, one of them being decision trees. The doubts come when I want to estimate the cross-validation error of the generated tree: tree <- rpart(y~., data=data.frame(xsel, y), cp=0.00001) ptree <- prune(tree, cp=tree$cptable[which.min(tree$cptable[,"xerror"]),"CP"]) ptree$cptable
2006 Sep 25
2
rpart
Dear r-help-list: If I use the rpart method like cfit<-rpart(y~.,data=data,...), what kind of tree is stored in cfit? Is it right that this tree is not pruned at all, that it is the full tree? If so, it's up to me to choose a subtree by using the printcp method. In the technical report from Atkinson and Therneau "An Introduction to recursive partitioning using the rpart
2008 Sep 16
1
1-SE rule in mvpart
Hello, I'm using mvpart option xv="1se" to compute a regression tree of good size with the 1-SE rule. To better understand 1-SE rule, I took a look on its coding in mvpart, which is : Let z be a rpart object , xerror <- z$cptable[, 4] xstd <- z$cptable[, 5] splt <- min(seq(along = xerror)[xerror <= min(xerror) + xvse * xstd]) I interprete this as following: the
2006 Oct 17
1
Some questions on Rpart algorithm
Hello: I am using rpart and would like more background on how the splits are made and how to interpret results - also how to properly use text(.rpart). I have looked through Venables and Ripley and through the rpart help and still have some questions. If there is a source (say, Breiman et al) on decision trees that would clear this all up, please let me know. The questions below pertain to a
2007 Jan 03
1
User defined split function in Rpart
Dear all, I'm trying to manage with user defined split function in rpart (file rpart\tests\usersplits.R in http://cran.r-project.org/src/contrib/rpart_3.1-34.tar.gz - see bottom of the email). Suppose to have the following data.frame (note that x's values are already sorted) > D y x 1 7 0.428 2 3 0.876 3 1 1.467 4 6 1.492 5 3 1.703 6 4 2.406 7 8 2.628 8 6 2.879 9 5 3.025 10 3 3.494
2005 Oct 14
1
Predicting classification error from rpart
Hi, I think I'm missing something very obvious, but I am missing it, so I would be very grateful for help. I'm using rpart to analyse data on skull base morphology, essentially predicting sex from one or several skull base measurements. The sex of the people whose skulls are being studied is known, and lives as a factor (M,F) in the data. I want to get back predictions of gender, and
2003 Apr 10
1
Classification problem - rpart
I am performing a binary classification using a classification tree. Ironically, the data themselves are 2483 tree (real biological ones) locations as described by a suite of environmental variables (slope, soil moisture, radiation load, etc). I want to separate them from an equal number of random points. Doing eda on the data shows that there is substantial difference between the tree and random
2005 Mar 29
1
regression tree xerror
I am running some models (for the first time) using rpart and am getting results I don't know how to interpret. I'm using cross-validation to prune the tree and the results look like: Root node error: 172.71/292 = 0.59148 n= 292 CP nsplit rel error xerror xstd 1 0.124662 0 1.00000 1.00731 0.093701 2 0.064634 1 0.87534 1.08076 0.092337 3 0.057300 2
2009 Mar 15
0
mvpart error - is.leaf
Hello, When trying to run mvpart either specifying my own parameters or using the defaults, I get the following error: Error in all(is.leaf) : unused argument(s) (c(FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE)) As far as I can tell, is.leaf is part of the dendrogam package, so I'm assuming there's some problem with the graphical parameters. However running same formula and data
2007 Mar 06
0
rpart-question regarding relation between cp and rel error
Dear useRs, I may be temporarily (I hope :-)) confused, and I hope that someone can answer this question that bugs me at the moment: In the CP table of rpart, I thought the following equation should hold: rel error = rel error(before) - (nsplit - nsplit(before)) * CP(before), where (before) always denotes the entry in the row above. While this equation holds for many rows of the CP tables