similar to: rpart, cross-validation errors question

Displaying 20 results from an estimated 1000 matches similar to: "rpart, cross-validation errors question"

2012 Feb 17
1
Different cp values in rpart() using plotcp() and printcp()
hi, I have a question regarding cp values in rpart(). When I use plotcp() I get a figure with cp values on the x-axsis, but then I use printcp() the cp values in that list are different from the values in the figure by plotcp(). Does someone know why? Silje [[alternative HTML version deleted]]
2012 Mar 04
1
rpart package, text function, and round of class counts
I run the following code: library(rpart) data(kyphosis) fit <- rpart(Kyphosis ~ ., data=kyphosis) plot(fit) text(fit, use.n=TRUE) The text labels represent the count of each class at the leaf node. Unfortunately, the numbers are rounded and in scientific notation rather than the exact number of examples sorted by that node in each class. The plot is supposed to look like
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
2011 Sep 08
1
"rpart" or "tree" function issue
I am trying to create a classification tree using either tree or rpart functions but when it comes to plotting the results the formatting I get is different than what I see in all the tutorials (like http://www.youtube.com/watch?v=9XNhqO1bu0A or http://www.youtube.com/watch?v=m3mLNpeke0I&feature=related or http://www.statmethods.net/advstats/cart.html "tree for kyphosis"). I am
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
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
2011 Jan 26
2
Extracting the terms from an rpart object
Hello all, I wish to extract the terms from an rpart object. Specifically, I would like to be able to know what is the response variable (so I could do some manipulation on it). But in general, such a method for rpart will also need to handle a "." case (see fit2) Here are two simple examples: fit1 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) fit1$call fit2 <-
2010 Aug 03
1
R: classification tree model!
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100803/9fb28807/attachment.pl>
2011 May 12
1
Saving misclassified records into dataframe within a loop
Greetings R world, I know some version of the this question has been asked before, but i need to save the output of a loop into a data frame to eventually be written to a postgres data base with dbWriteTable. Some background. I have developed classifications models to help identify problem accounts. The logic is this, if the model classifies the record as including variable X and it turns out
2006 Nov 02
1
Question on cross-validation in rpart
Hi R folks, I am using R version 2.2.1 for Unix. I am exploring the rpart function, in particular the rpart.control parameter. I have tried using different values for xval (0, 1, 10, 20) leaving other parameters constant but I receive the same tree after each run. Is the10 fold cross-validation default still running every time? I would expect the trees to change at least a little when I
2009 Dec 14
1
RPART - printing full splitting rule number on tree plot
Dear R-users I am using RPART package to get regression trees. However having trouble getting the text function to put the full splitting rule number on the plot, instead to puts it in scientific notation. When a covariate has 1e4 or greater number of digits then the splitting rule number displayed on the plot is in scientific notation. But print.rpart displays the splitting rules in full.
2010 Dec 13
2
rpart.object help
Hi, Suppose i have generated an object using the following : fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) And when i print fit, i get the following : n= 81 node), split, n, loss, yval, (yprob) * denotes terminal node 1) root 81 17 absent (0.7901235 0.2098765) 2) Start>=8.5 62 6 absent (0.9032258 0.0967742) 4) Start>=14.5 29 0 absent (1.0000000
2009 May 12
1
questions on rpart (tree changes when rearrange the order of covariates?!)
Greetings, I am using rpart for classification with "class" method. The test data is the Indian diabetes data from package mlbench. I fitted a classification tree firstly using the original data, and then exchanged the order of Body mass and Plasma glucose which are the strongest/important variables in the growing phase. The second tree is a little different from the first one. The
2009 May 22
1
bug in rpart?
Greetings, I checked the Indian diabetes data again and get one tree for the data with reordered columns and another tree for the original data. I compared these two trees, the split points for these two trees are exactly the same but the fitted classes are not the same for some cases. And the misclassification errors are different too. I know how CART deal with ties --- even we are using the
2009 Sep 14
1
summary of rpart-Object in tktext window?
Hi, is it possible to put a summary of an rpart-Object into a tktext-window? Here is what I'm trying to do: fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) tt <- tktoplevel() tex <- tktext(tt) tkpack(tex) tkinsert(tex, "end", summary(fit)) But since the summary of an object is a list, I always get back the following error-message: cannot handle object of
2010 Mar 07
1
Is there an equivalence of lm's “anova” for an rpart object ?
Simple example: # Classification Tree with rpart library(rpart) # grow tree fit <- rpart(Kyphosis ~ Age + Number + Start, method="class", data=kyphosis) Now I would like to know how can I measure the "importance" of each of my three explanatory variables (Age, Number, Start) in the model? If this was a regression model, I could have looked at p values from the
2012 Apr 12
2
enableJIT(2) causes major slow-up in rpart
Hello, Due to exploration of the JIT capabilities offered through the {compiler} package, I came by the fact that using enableJIT(2) can *slow* the rpart function (from the {rpart} package) by a magnitude of about 10 times. Here is an example code to run: library(rpart) require(compiler) enableJIT(0) # just making sure that JIT is off # We could also use enableJIT(1) and it would be fine fo
2011 Apr 22
3
Parametrized object name in Save statement
Greetings All, I am looking to write a parametrized Rscript that will accept a variable name(that also is the name of the flat file), transform the data into a data frame and preform various modeling on the structure and save the output and plot of the model. In this example i am using a rpart decision tree. The only problem i am having is integrating the parameter into the internal object name
2009 Feb 03
5
Large file size while persisting rpart model to disk
I am using rpart to build a model for later predictions. To save the prediction across restarts and share the data across nodes I have been using "save" to persist the result of rpart to a file and "load" it later. But the saved size was becoming unusually large (even with binary, compressed mode). The size was also proportional to the amount of data that was used to create the
2003 May 24
1
...listable functions...
Hi R-helpers. I have the following problem: I would like to apply my function gain(df,X,A) to a list of arguments. df is a data frame X,A are the varibales od data frame. When I do > gain(kyphosis,"Kyphosis",c("Start","Number")) [1] "Start" "Number" I get the following error... Error in unique.default(x) : unique() applies only to vectors I