Displaying 20 results from an estimated 3000 matches similar to: "pruning trees using rpart"
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]]
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
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
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
2010 May 03
1
rpart, cross-validation errors question
I ran this code (several times) from the Quick-R web page (
http://www.statmethods.net/advstats/cart.html) but my cross-validation
errors increase instead of decrease (same thing happens with an unrelated
data set).
Why does this happen?
Am I doing something wrong?
# Classification Tree with rpart
library(rpart)
# grow tree
fit <- rpart(Kyphosis ~ Age + Number + Start,
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
2001 Sep 14
0
rpart or Postscript problem?
I've run into another postscript/rpart problem unrelated to the issues I've
mentioned in a previous query.
I'm using 1.3.1 on a Win2K box.
>plotcp(some.rpart.object)
draws a very nice plot on the windows graphic device. If I save this as a
postscript file, either by opening a postscript device before calling
plotcp, or by saving the graphics window as a postscript file, the
2010 Mar 24
0
how to solve error in precict( ) while using with rpart?
Hello,
I am working with rpart function but geting some error in prediction.
the same code works fine with iris dataset.
but applying other dataset it doesn't work.
sample code is given for reference.
> acc_model<-rpart(V1~V2+V3+V4+V5+V6+V7+V8, data=accEx.train)
> plotcp(acc_model)
>
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>
2012 Sep 21
1
prune in rpart: choose number terminal nodes
Dear community,
I've an rpart object, and I know the CP I want. I'd like to know if it's
possible also to fix the number of terminal nodes I want.
Thanks in advance, user at host.com as user at host.com
--
View this message in context: http://r.789695.n4.nabble.com/prune-in-rpart-choose-number-terminal-nodes-tp4643837.html
Sent from the R help mailing list archive at
2009 Mar 20
1
Pruning trees in a Random Forest
Hi all!
The randomForest in R enables us to prune the trees using the nodesize
feature where we can stop splitting a node if it contains less than the
specified no.of of records/entities at that node.
However is there a way to stop the tree growing after a specified number of
levels. To be more clear on what I mean by a level. Level 0 is the parent
node, Level 1 has 2 daughter nodes, Level 2 has
2010 Dec 14
1
rpart - how to estimate the “meaningful” predictors for an outcome (in classification trees)
Hi dear R-help memebers,
When building a CART model (specifically classification tree) using rpart,
it is sometimes obvious that there are variables (X's) that are meaningful
for predicting some of the outcome (y) variables - while other predictors
are relevant for other outcome variables (y's only).
*How can it be estimated, which explanatory variable is "used" for which of
2011 Jan 11
0
Some questions concerning survival tree analysis using the rpart module
All the documentation that I have on survival splitting is found in the
technical report you mention. However, there is both a short form and a
long form of this on our web site, did you get the larger one (52
pages)? I admit it is not a lot.
There are no other split algorithms implimented for survival data. It
would be possible to add your own. Attached is a slightly updated
version of the
2012 Aug 01
1
rpart package: why does predict.rpart require values for "unused" predictors?
After fitting and pruning an rpart model, it is often the case that one or
more of the original predictors is not used by any of the splits of the
final tree. It seems logical, therefore, that values for these "unused"
predictors would not be needed for prediction. But when predict() is called
on such models, all predictors seem to be required. Why is that, and can it
be easily
2004 Apr 29
1
RPART drawing the tree
Hello,
I am using the RPART library to find patterns in HIV mutations regarding
drug-resistancy.
My data consists of aminoacid at certain locations and two classes resistant
and susceptible.
The classification and pruning work fine with Rpart. however there is a
problem with displaying the data as a tree in the display window.
in the display window the data contain only levels at the splits
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
2008 Mar 06
1
Rpart and bagging - how is it done?
Hi there.
I was wondering if somebody knows how to perform a bagging procedure on a
classification tree without running the classifier with weights.
Let me first explain why I need this and then give some details of what I
have found out so far.
I am thinking about implementing the bagging procedure in Matlab. Matlab
has a simple classification tree function (in their Statistics toolbox) but
2000 Mar 27
1
Behavior different inside function?
I'm stumped with this. When I execute the lines in the function singly, they
run fine, but when I run the function, I get this error on the read.table()
line:
Error in count.fields(file, sep, quote, skip) :
can't open file fspci1.dat
Can anyone tell my why this should be so? Here is the program:
library(rpart)
wait <- function(str="Press a key when ready...")
2005 May 04
1
Difference between "tree" and "rpart"
In the help for rpart it says, "This differs from the tree function
mainly in its handling of surrogate variables." And it says that an
rpart object is a superset of a tree object. Both cite Brieman et al.
1984. Both call external code which looks like martian poetry to me.
I've seen posts in the archives where BDR, and other knowledgeable
folks, have said that rpart() is to be
2009 Nov 30
3
rpart: how to assign observations to nodes in regression trees
Hi,
I am building a regression tree (method=anova) by using rpart package
and as a final result I get the final leaves characterized by
different means and standard deviations for the dependent variable.
However, differently from the classification tree for categorical
variables I cannot find a way to assign each observation to a leaf,
i.e. I can find no frame whcih contains the observation id