Displaying 20 results from an estimated 7000 matches similar to: "Fw: questions about rpart - cont."
2008 Oct 01
0
xpred.rpart() in library(mvpart)
R-users
E-mail: r-help@r-project.org
Hi! R-users.
http://finzi.psych.upenn.edu/R/library/mvpart/html/xpred.rpart.html
says:
data(car.test.frame)
fit <- rpart(Mileage ~ Weight, car.test.frame)
xmat <- xpred.rpart(fit)
xerr <- (xmat - car.test.frame$Mileage)^2
apply(xerr, 2, sum) # cross-validated error estimate
# approx same result as rel. error from printcp(fit)
apply(xerr, 2,
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
2004 Jun 11
1
Error when I try to build / plot a tree using rpart()
Hi,
I am using the rpart package to build a classification tree. I did
manage to build a tree with data on a previous project. However, when
attampting to build a tree on a project I am working on, I seem to be
getting the error shown below:
> nhg3.rp <- rpart(profitresp ~., nhg3, method="class")
> plot(nhg3.rp, branch=0.4, uniform=T); text(nhg3.rp, digits=3)
Error in
2013 Jan 27
2
rpart
Hi,
When I look at the summary of an rpart object run on my data, I get 7 nodes but when I plot the rpart object, I get only 3 nodes. Should the number of nodes not match 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
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
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]]
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,
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 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
2004 Jun 04
1
rpart
Hello everyone,
I'm a newbie to R and to CART so I hope my questions don't seem too stupid.
1.)
My first question concerns the rpart() method. Which method does rpart use in
order to get the best split - entropy impurity, Bayes error (min. error) or Gini
index? Is there a way to make it use the entropy impurity?
The second and third question concern the output of the printcp() function.
2009 Nov 21
2
Fw: Re: title problem
It seems that there is a problem in
displaying subtitle in general, independently from
multi-plot display. when I do
plot (c(1,2,3), c(9,8,7), type = "l")
title(main = "Main title", sub ="Sub title",cex.main=2,
cex.sub = 2)
subtitle doesn't get displayed
> --- On Sat, 11/21/09, David Winsemius <dwinsemius at comcast.net>
> wrote:
>
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
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
2009 Nov 04
0
Fw: ROC
if nobody knows the answer to my question on time-dependent ROC (see below), does any body know how TP and FP are related to classes and samples (orders) in non-time dependent ROC? Any reference?
Thanks
--- On Tue, 11/3/09, carol white <wht_crl at yahoo.com> wrote:
> From: carol white <wht_crl at yahoo.com>
> Subject: ROC
> To: r-help at stat.math.ethz.ch
> Date:
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
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
2010 May 11
1
how to extract the variables used in decision tree
HI, Dear R community,
How to extract the variables actually used in tree construction? I want to
extract these variables and combine other variable as my features in next
step model 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
2008 Oct 27
0
Displaying number of Y/N affected by tree in rule form RE: R question/request on rules from rpart
Hi Prof. Williams,
thanks for your suggestion. The updated code is below.
It turns out it was a matter of displaying the second column in
yval to get the number of N and subtracting it from the n column in the
frame to get the number of Y remaining in a binary example.
once this is added now the function returns the rules along with
Y and N count affected by the resulting rule.
I am ccing
2003 Feb 12
1
rpart v. lda classification.
I've been groping my way through a classification/discrimination
problem, from a consulting client. There are 26 observations, with 4
possible categories and 24 (!!!) potential predictor variables.
I tried using lda() on the first 7 predictor variables and got 24 of
the 26 observations correctly classified. (Training and testing both
on the complete data set --- just to get started.)
I