Displaying 11 results from an estimated 11 matches for "maxsurrogate".
2007 Dec 10
1
Multiple Reponse CART Analysis
...edictor of ten multiple diet taxa abundances (prey.data) Neither rpart or mvpart seem to allow me to do multiple responses. (Or if they can, I'm not using the functions properly.)
> library(rpart)
> turtle.rtree<-rpart(prey.data~., data=turtle.data$Clength, method="anova", maxsurrogate=0, minsplit=8, minbucket=4, xval=10); plot(turtle.rtree); text(turtle.rtree)
Error in terms.formula(formula, data = data) :
'.' in formula and no 'data' argument
When I switch response for predictor, it works. But this is the opposite of what I wanted to test and gives me...
2002 Mar 29
1
memory error with rpart()
Dear all,
I have a 100 iteration loop. Within each loop, there are some calls
to rpart() like:
ctl <- rpart.control(maxcompete=0, maxsurrogate=0, maxdepth=10)
temp <- rpart(y~., x, w=wt, method="class", parms=list(split="gini"),
control=ctl)
res <- log(predict.rpart(temp, type="prob"))
newres <- log(predict.rpart(temp, newdata=newx, type="prob"))
The code runs fine for the first 30-60 iter...
2005 Jan 27
0
how to evaluate the significance of attributes in tree gr owing
FWIW, I wrote a little function to extract variable importance as defined in
the CART book a while ago. It's rather limited: Only works for regression
problem, and you need to set maxsurrogate=0 and maxcompete=0. It may (or
may not) help you:
varimp.rpart <- function(x) {
dev <- x$frame[, c("var", "dev")]
dev <- dev[dev$var != "<leaf>", ]
improve <- x$split[, "improve"]
imp <- tapply(dev[, 2] * improve, dev$va...
2012 Jan 06
1
Please help!! How do I set graphical parameters for ploting ctree()
...nderstand how to set graphical parameters for trees created with the party package. For example take the following code:
library(party)
data(airquality)
airq <- subset(airquality, !is.na(Ozone))
airct <- ctree(Ozone ~ ., data = airq,
controls = ctree_control(maxsurrogate = 3))
plot(airct)
My problem is, I've got a ctree that has 14 terminal nodes, and as a result of the default graphical paramters of plot(ctree), all of the text is completely undreadable (decison node text is too large and as a result, these nodes overlap one another, terminal node barplo...
2012 Apr 03
1
rpart error message
...Message() to retrieve the
error.
When we execute the following command,
cnr_model<-rpart(as.factor(Species)~Sepal Length+Sepal Width+Petal Length,
method="class", parms=list(split="gini",prior=c()),
control=rpart.control(minsplit=2,
na.action=na.pass,cp=0.001,usesurrogate=1,maxsurrogate=2,surrogatestyle=0,maxdepth=20,xval=10))
we get an error message* "Error: unexpected symbol in
"a<-cnr_model<-rpart(as.factor(Species)~Sepal Length""*
The REXP returned in not null and the geterrMessage() call doesnt return an
error message.
But for other errors in R ,...
2007 Apr 19
1
"tree-ID" in any segmentation package available?
Dear R-helpers,
I am looking for a segmentation package that gives some "tree identifier"
as output for every observation in the data set (my response variable is
binary). I have skimmed through "rpart", "ada" and "adabag": The output
"trees" gives you the formula, but I have to run several thousand
segmentations on different data sets and it
2006 Jul 14
1
party - ctree() - terminal nodes reference for every obs
Dear R.Users,
using ctree() (from "party" library) on a data.frame, I want to append a
column with the references for the groups/segments detected. While these
nodes are easy readable in output, I need a vector for my obs.
Hints?
Cheers
--
Daniele Medri
2009 May 08
1
Get (feature, threshold) from Output of rpart() for Stump Tree
Hi,
I have a question regarding how to get some partial information
from the output of rpart, which could be used as the first argument to
predict. For example, in my code, I try to learn a stump tree (decision
tree of depth 2):
"fit <- rpart(y~bx, weights = w/mean(w), control = cntrl)
print(fit)
btest[1,] <- predict(fit, newdata = data.frame(bx)) "
I found
2011 Jul 31
1
R: print and ctree
I have run the ctree function, and my dependent variable is broken into 3
categories: low cost, moderate cost and high cost.
When i plot the results (eg. using plot(test.ct)), the plot shows, at the
very bottom of each node, the probability of falling into each cost
category.
When i print the actual results (eg. using print(test.ct)), i get all of the
backup
2011 Feb 17
1
missing values in party::ctree
After ctree builds a tree, how would I determine the direction missing values follow by examining the BinaryTree-class object? For instance in the example below Bare.nuclei has 16 missing values and is used for the first split, but the missing values are not listed in either set of factors. (I have the same question for missing values among numeric [non-factor] values, but I assume the answer
2009 Jul 26
3
Question about rpart decision trees (being used to predict customer churn)
Hi,
I am using rpart decision trees to analyze customer churn. I am finding that
the decision trees created are not effective because they are not able to
recognize factors that influence churn. I have created an example situation
below. What do I need to do to for rpart to build a tree with the variable
experience? My guess is that this would happen if rpart used the loss matrix
while creating