Displaying 20 results from an estimated 10000 matches similar to: "Offset - usersplits function package RPART"
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
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
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
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
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,
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
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
2007 Nov 26
1
anyway to force rpart() to include a specific predictor
If I understand correctly, rpart() will pick predictor at each node
automatically. I am wondering if there is a way to force rpart()
including a specific predictor. The reason I am asking is that I'd
like to use rpart() to detect interaction terms for some variables.
Thanks.
2007 Feb 27
3
rpart minimum sample size
Is there an optimal / minimum sample size for attempting to construct a
classification tree using /rpart/?
I have 27 seagrass disturbance sites (boat groundings) that have been
monitored for a number of years. The monitoring protocol for each site
is identical. From the monitoring data, I am able to determine the
level of recovery that each site has experienced. Recovery is our
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
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
2009 Jun 09
3
rpart - the xval argument in rpart.control and in xpred.rpart
Dear R users,
I'm working with the rpart package and want to evaluate the performance of
user defined split functions.
I have some problems in understanding the meaning of the xval argument in
the two functions rpart.control and xpred.rpart. In the former it is defined
as the number of cross-validations while in the latter it is defined as the
number of cross-validation groups. If I am
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
2005 Mar 21
1
rpart memory problem
Hi everyone,
I have a problem using rpart (R 2.0.1 under Unix)
Indeed, I have a large matrix (9271x7), my response variable is numeric and all
my predictor variables are categorical (from 3 to 8 levels).
Here is an example :
> mydata[1:5,]
distance group3 group4 group5 group6 group7 group8
pos_1 0.141836040224967 a c e a g g
pos_501
2004 Nov 10
1
Does something like partition.rpart() exist?
I'd like to create a bidimensional presentation of a classification tree
built using the rpart() function. I've seen that a partition.tree()
function exists for the tree() function. Does a similar function exist
for the rpart() function?
Thanks a lot Simone Vantini
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
2008 Feb 26
1
predict.rpart question
Dear All,
I have a question regarding predict.rpart. I use
rpart to build classification and regression trees and I deal with data with
relatively large number of input variables (predictors). For example, I build an
rpart model like this
rpartModel <- rpart(Y ~ X, method="class",
minsplit =1, minbucket=nMinBucket,cp=nCp);
and get predictors used in building the model like
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
2003 Jun 17
1
User-defined functions in rpart
This question concerns rpart's facility for user-defined functions that
accomplish splitting.
I was interested in modifying the code so that in each terminal node,
a linear regression is fit to the data.
It seems that from the allowable inputs in the user-defined functions,
that this may not be possible, since they have the form:
function(y, wt, parms) (in the case of the