Displaying 20 results from an estimated 40000 matches similar to: "User defined split function in rpart"
2005 May 25
0
Error with user defined split function in rpart (PR#7895)
Full_Name: Bill Wheeler
Version: 2.0.1
OS: Windows 2000
Submission from: (NULL) (67.130.36.229)
The program to reproduce the error is below. I am calling rpart with a
user-defined split function for a binary response variable and one continuous
independent variable. The split function works for some datasets but not
others.
The error is:
Error in "$<-.data.frame"(`*tmp*`,
2002 Aug 28
0
user defined function in rpart
Hi,
I am trying to use the rpart library with my own set of functions on a
survival object. I get an immeadiate segmentation fault when i try
calling rpart with my list of functions. I get the same problem with the
logrank example from Therneau,s S-rpart library though their anova
example works. Should I report this as a bug, as even if my functions
are structured improperly, that should lead to
2009 May 14
0
Rpart - user defined split functions
Dear all,
I'm writing my own method to be used in Rpart by defining the list of
functions named init, split and eval. I'm following the example given in the
file 'tests/usersplits.R' in the sources.
By now I'm able to define the split function (and it works correctly in the
tree construction) while I have some problems with the init and the eval
function.
The task I'm
2005 Aug 26
1
Help in Compliling user -defined functions in Rpart
I have been trying to write my own user defined function in Rpart.I
imitated the anova splitting rule which is given as an example.In the
work I am doing ,I am calculating the concentration index(ci) ,which
is in between -1 and +1.So my deviance is given by
abs(ci)*(1-abs(ci)).Now when I run rpart incorporating this user
defined function i get the following error message:
Error in
2007 Feb 18
3
User defined split function in rpart
Dear R community,
I am trying to write my own user defined split function for rpart. I read
the example in the tests directory and I understand the general idea of the
how to implement user defined splitting functions. However, I am having
troubles with addressing the data frame used in calling rpart in my split
functions.
For example, in the evaluation function that is called once per node,
2009 May 26
0
cross-validation in rpart
Dear R users,
I know cross-validation does not work in rpart with user defined split
functions. As Terry Therneau suggested, one can use the xpred.rpart function
and then summarize the matrix of the predicted values into a single
"goodness" value.
I need only a confirmation: set for example xval=10, if I correctly
understood a single column of the matrix obatined by xpred.rpart gives
2008 Feb 14
0
User defined split function in Rpart
The question is about the direction vector in rpart.
There are (at least) two preferred ways to lay out a tree, wrt the question of
which obs are sent left and which right.
1. Send the smaller y values to the left. In the final tree, there will be
a graphical ordering with smaller y's to the left and larger ones to the right.
One has a "left bad, right good"
2009 Dec 15
1
user-written splits in rpart
Hi,
I am trying to write my own split function for rpart. The aim is to do, instead of anova, a linear regression to determine the split (minimize some criterion like sum of rss left and right of the split). The regression (lm) should simply use the dependent and independent variables passed to rpart.
I am aware of the example provided in the rpart source code, but stumbled on similar problems
2007 Jan 03
1
User defined split function in Rpart
Dear all,
I'm trying to manage with user defined split function in rpart
(file rpart\tests\usersplits.R in
http://cran.r-project.org/src/contrib/rpart_3.1-34.tar.gz - see bottom of
the email).
Suppose to have the following data.frame (note that x's values are already
sorted)
> D
y x
1 7 0.428
2 3 0.876
3 1 1.467
4 6 1.492
5 3 1.703
6 4 2.406
7 8 2.628
8 6 2.879
9 5 3.025
10 3 3.494
2006 Feb 16
0
sums of absolute deviations about the median as split function in rpart
Dear R community,
as stated in Breiman et.al. (1984) and De'Ath & Fabricius (2000) using
sums of absolute deviations about the median as an impurity measure
gives robust trees.
I would like to use this method in rpart.
Has somebody already tried this method in rpart? Is there maybe already
a script available somewhere?
I am aware of the possibility to define usersplits myself with
2004 Jul 05
1
how to personalize split function in rpart
Hallo!
I am a student of the Politecnico di Milano (Milan, italy) and I'm working
on CARTs. I'm trying to use the R rpart function with a personalized splitfunction... but I'm not able to do it!
More precisely, I would like to know what is the meaning of the function
'init', 'split' and 'eval' named in the help page.I can't find any answer
in
2008 Jul 03
1
cross-validation in rpart
Hello list,
I'm having a problem with custom functions in rpart, and before I tear my
hair out trying to fix it, I want to make sure it's actually a problem. It
seems that, when you write custom functions for rpart (init, split and eval)
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
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
2010 Mar 05
1
I can't find "rpart" help (linux)
Hi
I have installed rpart in my Linux (PLD) but I don't know how I may find
help conect this package?
Here is my instalaction:
> install.packages("rpart",dependencies=TRUE)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://r.meteo.uni.wroc.pl/src/contrib/rpart_3.1-46.tar.gz'
Content type 'application/x-gzip' length 136572 bytes (133
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
1999 Dec 23
1
rpart on Alpha under OSF
Running on an Alpha machine which reports (uname -a)
OSF1 bsdx01.bs.ehu.es V4.0 878 alpha
and using the binary distribution put together by Albrecht Gebhardt
(in http://cran.at.r-project.org/bin/osf/osf4.0/tar/alpha_ev5/) I
obtain core dumps whenever I try to use package rpart. I have R
REMOVE'd the rpart package, downloaded the source rpart_1.0-7.tar from
CRAN and
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
2008 Jul 31
1
predict rpart: new data has new level
Hi. I uses rpart to build a regression tree. Y is continuous. Now, I try
to predict on a new set of data. In the new set of data, one of my x (call
Incoterm, a factor) has a new level.
I wonder why the error below appears as the guide says "For factor
predictors, if an observation contains a level not used to grow the tree, it
is left at the deepest possible node and
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
2007 Dec 16
1
paste dependent variable in formula (rpart)?
Hello,
i'm trying to replace different target variables in rpart with a
function. The data.frame getting always the target variable as last column.
Try below, i get the target variable in the explained variables, too!?
Have anybody an advice to avoid this.
rp1 <- rpart(eval(parse(text=paste(names(train[length(train)])))) ~ . ,
data=train,cp=0.0001)
regards & many thanks