search for: xerror

Displaying 20 results from an estimated 37 matches for "xerror".

Did you mean: error
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 simplest tree with xerror under min(xerror) + its own xstd Neverthless, in some article I read the following rule: the simplest tree with...
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 0.81070 1.07684 0.095582 4 0.038462 4 0.69610 0.99104 0.091659 5 0.036200 5 0.65764 1.01596 0.094635 6 0.029228 7 0.58524 1.00058 0.095440 7 0.028779...
2010 Apr 30
1
how is xerror calculated in rpart?
Hi, I've searched online, in a few books, and in the archives, but haven't seen this. I believe that xerror is scaled to rel error on the first split. After fitting an rpart object, is it possible with a little math to determine the percentage of true classifications represented by a xerror value? -seth -- View this message in context: http://r.789695.n4.nabble.com/how-is-xerror-calculated-in-rpart-tp...
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 corrected by adding ylim to the list of formal argument and wrapping the definition of ylim with 'if(missing(ylim))'...
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 each xerror overlap f...
2012 Dec 07
0
loop for calculating 1-se in rpart
...t 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 output that is being referenced in the code below Regression tree: rpart(formula = chbiomsq ~ HC + BC + POC + RUG + Depth + Exp + DFP + FI + LAT, data = ch, method = "anova", control = rpart.control(minsplit = 10, cp = 0.01, xval = 10)) Variables actually used in t...
2011 Dec 31
1
Cross-validation error with tune and with rpart
...rs 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 CP nsplit rel error xerror xstd 1 0.33120000 0 1.0000 1.0000 0.02856022 2 0.08640000 1 0.6688 0.6704 0.02683544 3 0.02986667 2 0.5824 0.5856 0.02584564 4 0.02880000 5 0.4928 0.5760 0.02571738 5 0.01920000...
2010 Oct 12
2
repeating an analysis
...printcp(fit1) Regression tree: rpart(formula = CHAB ~ ., data = chabun, method = "anova", control = rpart.control(minsplit = 10, cp = 0.01, xval = 10)) Variables actually used in tree construction: [1] EXP LAT POC RUG Root node error: 35904/33 = 1088 n= 33 CP nsplit rel error xerror xstd 1 0.539806 0 1.00000 1.0337 0.41238 2 0.050516 1 0.46019 1.2149 0.38787 3 0.016788 2 0.40968 1.2719 0.41280 4 0.010221 3 0.39289 1.1852 0.38300 5 0.010000 4 0.38267 1.1740 0.38333 Each time I re-run the model I will get a slightly different output. I want...
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 0.029306 4 0.64949 0.83275 0.12074 4 0.018943 5 0.62019 0.86994 0.12467 5 0.010503 6 0....
2006 Sep 25
2
rpart
...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 routines" from 2000, one can see the following table on page 15: CP nsplit relerror xerror xstd 1 0.105 0 1.00000 1.0000 0.108 2 0.056 3 0.68519 1.1852 0.111 3 0.028 4 0.62963 1.0556 0.109 4 0.574 6 0.57407 1.0556 0.109 5 0.100 7 0.55556 1.0556 0.109 Some lines below it says "We see that the best tree has 5 terminal node...
2010 Apr 02
0
(no subject)
...ibha I read R-help as a digest so often come late to a discussion. Let me start by being the first to directly answer the question: > fit <- rpart(time ~ age +ph.ecog,lung) > summary(fit) Call: rpart(formula = time ~ age + ph.ecog, data = lung) n= 228 CP nsplit rel error xerror xstd 1 0.03516666 0 1.0000000 1.009949 0.1137819 2 0.01459053 1 0.9648333 1.049636 0.1282259 3 0.01324335 3 0.9356523 1.090562 0.1301632 4 0.01000000 7 0.8810284 1.063609 0.1298557 Node number 1: 228 observations, complexity param=0.03516666 mean=305.2325, MSE=44176.9...
2007 Feb 13
5
gtk-window-decorator segfault
On kde, gtk-window-decorator segfault everytime a minimised "Konqueror download window" close it self... Running with --sync fix the problem so no way to have a backtrace :( Cedric
2006 Oct 17
1
Some questions on Rpart algorithm
...rcentages of each class rather then counts. I don't see an option for this so would like to modify the text.rpart. However, I can't find the source since it is a method that's "hidden". How can I find the source? (2) printcp prints a table with columns cp, nsplit, rel error, xerror, xstd. I am guessing that cp is complexity, nsplit is the number of the split, rel error is the error on test set, xerror is cross-validation error and xstd is standard deviation of error across the cross-validation sets. Is there any documentation on this? For instance, how exactly is complexity c...
2009 May 26
0
cross-validation in rpart
...esults obtained with a tree, say A, obtained with "class" method with the one, say B, I get with my custom functions (init, split and eval). I should compare the cp tables for the two fitted rpart object. For tree B I only have the "rel error" column and I need to obtain the xerror and the xstd columns as for tree A. To this aim I should know how this values are computed. I guess they depend on the xval value (in rpart.control) which is set to 10 by default. Does this mean that the observations are divided into 10 groups and, as before, the xerror is computed by averaging...
2010 Feb 26
2
Error in mvpart example
...d="dist") #directly from ?rpart summary(fit3) ...which returned the following: Error in apply(formatg(yval, digits - 3), 1, paste, collapse = ",", sep = "") : dim(X) must have a positive length This seems to be a problem with the cross-validation, since the "xerror" and "xstd" columns are missing from the summary table as well. Using the mpart() wrapper results in the same error: fit4<-mvpart(gdist(spider[,1:12],meth="bray",full=TRUE,sq=TRUE)~water+twigs+reft+herbs+moss+sand,spider,method="dist") summary(fit4) Note, ch...
2010 May 11
1
how to extract the variables used in decision tree
...el building. > printcp(fit.dimer) Classification tree: rpart(formula = outcome ~ ., data = p_df, method = "class") Variables actually used in tree construction: [1] CT DP DY FC NE NW QT SK TA WC WD WG WW YG Root node error: 608/1743 = 0.34882 n= 1743 CP nsplit rel error xerror xstd 1 0.185033 0 1.00000 1.00000 0.032726 2 0.052632 2 0.62993 0.65132 0.028773 3 0.026316 4 0.52467 0.58059 0.027596 4 0.025768 5 0.49836 0.57072 0.027419 5 0.019737 8 0.42105 0.56086 0.027239 6 0.018092 9 0.40132 0.55263 0.027087 7 0.013158 12...
2008 Jul 03
1
cross-validation in rpart
...al) 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 rpart function, and then change fit1 and fit2 so that the both have xvals of 10. The problem occurs in that the cptable for fit1 doesn't have xerror or xstd, despite the fact that the cross-validation is set to 10-fold. I guess I just need conformation that cross-validation doesn't work with custom functions, and if someone could explain to me why that is the case it would be greatly appreciated. Thanks, Sam Stewart -- Sam Stewart, MMat...
2005 Oct 14
1
Predicting classification error from rpart
...rpart produces output like this :- > printcp(rpart.LFM) Classification tree: rpart(formula = Sex ~ LFM, data = Brides2) Variables actually used in tree construction: LFM Root node error: 44/104 = 0.42308 n= 104 CP nsplit rel error xerror xstd 1 0.227273 0 1.00000 1.00000 0.11451 2 0.113636 1 0.77273 0.95455 0.11372 3 0.022727 2 0.65909 0.95455 0.11372 4 0.010000 5 0.59091 0.95455 0.11372 > Presumably 'root node error' and 'rel error' are something to do with error but what? 'Ro...
2003 Apr 10
1
Classification problem - rpart
...slope=0,0.1011371,0.1013844,0.2027681,0.2267014,0.32......... MISSING 2392 3 random (0.001254181 0.998745819) * This is not like other trees I have run! And: summary(tree) > summary(tree) Call: rpart(formula = class ~ curvegrid + slope + tci10) n= 4966 CP nsplit rel error xerror xstd 1 0.9609344 0 1.00000000 1.0322191 0.01418310 2 0.0100000 1 0.03906565 0.7635924 0.01378822 Node number 1: 4966 observations, complexity param=0.9609344 predicted class=dw expected loss=0.5 class counts: 2483 2483 probabilities: 0.500 0.500 left son=2 (25...
2013 Jan 27
2
rpart
...in the results of the 2 functions (summary and plot) or it is not always the same? Look forward to your reply, Carol -------------------------------------------- ?summary(rpart.res) Call: rpart(formula = mydata$class ~ ., data = as.data.frame(t(mydata))) ? n= 62 ???????? CP nsplit rel error??? xerror????? xstd 1 0.6363636????? 0 1.0000000 1.0000000 0.1712469 2 0.1363636????? 1 0.3636364 0.6818182 0.1532767 3 0.0100000????? 2 0.2272727 0.7727273 0.1596659 Variable importance ? Hsa.627?? Hsa.692 Hsa.692.2? Hsa.3306?? Hsa.601?? Hsa.831? Hsa.1832? Hsa.2456 ?????? 19??????? 13??????? 11??????? 10?...