similar to: Help on rpart

Displaying 20 results from an estimated 10000 matches similar to: "Help on 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
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
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
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
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 Apr 27
1
coding of categories in rpart
Hello, I am using rpart to derive classification rules for customer segments. I have a few categorical variables in the set of independent variables. For instance, Account Size can be (Very-Small, Small, Medium, Large, V-Large) Rpart seems to encode these categories into: a,b,c,d,e The results are expressed in terms of the encoded values. How do I find out what encoding was used by rpart.
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
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
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
2007 Feb 02
1
Adding Histograms to Leaves of Rpart Tree or other Dendrogram
Hi - I'm trying to append simple density histograms of a continuous variable to the leaves of an rpart tree. The splits in the tree are all levels of a factor and I'm hoping to make the histograms out of the subsets of the dataframe corresponding to the splits and for them to be attached to the appropriate leaf of the final tree. Any help would be much appreciated, thanks, Jon Zelner
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()
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
2004 May 13
2
R 1.9.0 and pred.rpart
I have just upgraded from R 1.7.3 to R 1.9.0 and have found that the predict function no longer works for rpart: > predict(hmmm,sim3[1:10,]) Error in predict.rpart(hmmm, sim3[1:10, ]) : couldn't find function "pred.rpart" I have re-installed the rpart package to no avail. Any ideas? Giles Hooker
2011 Sep 07
2
rpart/tree issue
I am trying to create a classification tree using either tree or rpart but when it comes to plotting the results the formatting I get is different than what I see in all the tutorials. What I would like to see is the XX/XX format but all I get is a weird decimal value. I was also wondering how you know which is yes and which is no in each leaf of the tree? Is yes always on the left?
2011 Aug 25
2
rpart: plot without scientific notation
While I'm very pleased with the results I get with rpart and rpart.plot, I would like to change the scientific notation of the dependent variable in the plots into integers. Right now all my 5 or more digit numbers are displayed using scientific notation. I managed to find this: http://tolstoy.newcastle.edu.au/R/e8/help/09/12/8423.html but I do not fully understand what to change, and to
2014 Aug 13
1
Request to review a patch for rpart
Dear list For my work, it would be helpful if rpart worked seamlessly with an empty model: library(rpart); rpart(formula=y~0, data=data.frame(y=factor(1:10))) Currently, an unrelated error (originating from na.rpart) is thrown. At some point in the near future, I'd like to release a package to CRAN which uses rpart and relies on that functionality. I have prepared a patch (minor
2007 Feb 15
2
Does rpart package have some requirements on the original data set?
Hi, I am currently studying Decision Trees by using rpart package in R. I artificially created a data set which includes the dependant variable (y) and a few independent variables (x1, x2...). The dependant variable y only comprises 0 and 1. 90% of y are 1 and 10% of y are 0. When I apply rpart to it, there is no splitting at all. I am wondering whether this is because of the
2006 Aug 09
2
How to draw the decision boundaries for LDA and Rpart object
Hello useR, Could you please tell me how to draw the decision boundaries in a scatterplot of the original data for a LDA or Rpart object. For example: > library(rpart) >fit.rpart <- rpart(as.factor(group.id)~., data=data.frame(Data) ) How can I draw the cutting lines on the orignial Data? Or is there any built in functions that can read the rpart object 'fit.rpart' to do
2001 Aug 12
2
rpart 3.1.0 bug?
I just updated rpart to the latest version (3.1.0). There are a number of changes between this and previous versions, and some of the code I've been using with earlier versions (e.g. 3.0.2) no longer work. Here is a simple illustration of a problem I'm having with xpred.rpart. iris.test.rpart<-rpart(iris$Species~., data=iris[,1:4], parms=list(prior=c(0.5,0.25, 0.25))) + ) >