Displaying 20 results from an estimated 10000 matches similar to: "coding of categories in rpart"
2001 Aug 02
1
Missing value in Rpart
Hi, all
Our understanding of how classification trees in Rpart treat missing is
that if the variable is ordinal(continous), Rpart, by default, imputes a
value for missing. How do we do the classification tree and tell Rpart not
to impute. That is, what command is used to turn off the imputation.
Also, if we do get true missing, how does classification tree analysis in
Rpart treat missing when
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
2005 Jan 25
3
multi-class classification using rpart
Hi,
I am trying to make a multi-class classification tree by using rpart.
I used MASS package'd data: fgl to test and it works well.
However, when I used my small-sampled data as below, the program seems
to take forever. I am not sure if it is due to slowness or there is
something wrong with my codes or data manipulation.
Please be advised !
The data is described as the output from str()
2002 Jan 02
1
No subject
Any rpart user:
I am trying to construct an rpart tree using a subset of the data and it
will occasionally fail when predicting a categorical response variable.
The reason that rpart fails is that the subset does not contain each of the
categories present in the original data. For example, in the car.test.frame
example, a subset that has all the categories except "Small" will not
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
2011 Jun 13
1
In rpart, how is "improve" calculated? (in the "class" case)
Hi all,
I apologies in advance if I am missing something very simple here, but since
I failed at resolving this myself, I'm sending this question to the list.
I would appreciate any help in understanding how the rpart function is
(exactly) computing the "improve" (which is given in fit$split), and how it
differs when using the split='information' vs split='gini'
2002 Jan 25
0
rpart subsets
A few weeks back I posted that the subset feature of rpart was not working
when predicting a categorical variable. I was able to figure out a simple
solution to the problem that I hope can be included in future editions of
rpart. I also include a fix for another related problem.
The basic problem is that when predicting a categorical using a subset, the
subset may not have all the categories
2002 Jan 28
0
rpart subset fix
(Apparently, I posted this to the wrong place. I am hopefully posting this
is the correct place now. If not, please advise.)
A few weeks back I posted that the subset feature of rpart was not working
when predicting a categorical variable. I was able to figure out a simple
solution to the problem that I hope can be included in future editions of
rpart. I also include a fix for another related
2012 Jan 08
2
rpart question
We are trying to make a decision tree using rpart and we are continually
running into the following error:
> fit_rpart=rpart(ENROLL_YN~MINORITY,method="class")
> summary(fit_rpart)
Call:
rpart(formula = ENROLL_YN ~ MINORITY, method = "class")
n= 5725
CP nsplit rel error
1 0 0 1
Error in yval[, 1] : incorrect number of dimensions
ENROLL_YN is a
2005 Sep 20
1
Interpretation of csplit from rpart.object
Dear members of R-list,
I need to reproduce the rules of a decision tree. For that I need to use the
csplit information from the rpart.object. But I cannot uderstand the
information because from my example I get:
> rpart.tree$csplit
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1 3 3 1 3 3 3
[2,] 2 3 3 1 2 2 2
[3,] 1 3 3 1 3 3 3
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
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
2007 May 25
1
Problem with rpart
I work on Windows, R version 2.4.1. I'm very new with R!
I am trying to build a classification tree using rpart but, although the
matrix has 108 variables, the program builds a tree with only one split
using one variable! I know it is probable that only one variable is
informative, but I think it's unlikely. I was wondering if someone can help
me identify if I'm doing something
2003 Feb 28
2
Help on rpart
To whom it may concern,
I am using the rpart() function to perform a recursive tree analysis on a
set
of data that includes both numerical and categorical attributes.
At the end of the analysis, I would like to see the linear model at each
node in the tree. In particular, I would like to see each node specific
model coefficients
associated with each of the independent variables and intercepts.
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
2007 Feb 02
2
Regression trees with an ordinal response variable
Hi,
I am working on a regression tree in Rpart that uses a continuous response
variable that is ordered. I read a previous response by Pfr. Ripley to a
inquiry regarding the ability of rpart to handle ordinal responses in
2003. At that time rpart was unable to implement an algorithm to handle
ordinal responses. Has there been any effort to rectify this in recent
years?
Thanks!
Stacey
On
2009 Dec 07
2
problem in labeling the nodes of tree drawn by rpart
Hi all,
I used rpart to fit a model, where the covariates in the model are
categorical variables.
Then I plotted the tree (mytree) and used the command "text" to add labels
to the tree.
In the nodes of the tree, the values of the covariates are represented with
a, b or c.
Is there a way to show the real value(s) of the variable in the nodes
instead of a, b or c ?
I found that the
2018 Aug 14
2
Xenial rpart package on CRAN built with wrong R version?
Hello,
I just upgraded my Ubuntu Xenial system to R 3.5.1 (from 3.4.?) by changing the sources.list entry and doing an "apt-get dist-upgrade". Everything works except loading the rpart package in R:
> library(rpart)
Error: package or namespace load failed for ?rpart?:
package ?rpart? was installed by an R version with different internals; it needs to be reinstalled for use with
2008 Jul 22
2
rpart$where and predict.rpart
Hello there. I have fitted a rpart model.
> rpartModel <- rpart(y~., data=data.frame(y=y,x=x),method="class", ....)
and can use rpart$where to find out the terminal nodes that each
observations belongs.
Now, I have a set of new data and used predict.rpart which seems to give
only the predicted value with no information similar to rpart$where.
May I know how
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