similar to: need help with plot.rpart and text.rpart

Displaying 20 results from an estimated 3000 matches similar to: "need help with plot.rpart and text.rpart"

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
2007 Feb 20
1
text.rpart for the "class" method doesn't act on label="yprob"
Hello All, Am I misreading the documentation? The text.rpart documentation says: "label a column name of x$frame; values of this will label the nodes. For the "class" method, label="yval" results in the factor levels being used, "yprob" results in the probability of the winning factor level being used, and ?specific yval level? results in the probability of
2008 Oct 27
0
Displaying number of Y/N affected by tree in rule form RE: R question/request on rules from rpart
Hi Prof. Williams, thanks for your suggestion. The updated code is below. It turns out it was a matter of displaying the second column in yval to get the number of N and subtracting it from the n column in the frame to get the number of Y remaining in a binary example. once this is added now the function returns the rules along with Y and N count affected by the resulting rule. I am ccing
2002 Mar 13
0
rpart error with 0-frequency factor levels (with partial fix) (PR#1378)
(I'm sending to r-bugs because rpart is one of the recommended packages and is always installed. I'm also sending it directly to Dr. Ripley, as the maintainer.) rpart working as a classifier does not work (produces no splits) when the class indicator has no instances of one of the factor levels, as long as the factor level is not the final level. I have at least a partial fix, which I
2005 Sep 24
1
rpart Error in yval[, 1] : incorrect number of dimensions
I tried using rpart, as below, and got this error message "rpart Error in yval[, 1] : incorrect number of dimensions". Thinking it might somehow be related to the large number of missing values, I tried using complete data, but with the same result. Does anyone know what may be going on, and how to fix it? I have traced two similar error messages in the Archive, but following the
2011 Jan 26
1
Inconsistencies in the rpart.object help file?
Hello all, I'm was going through the help for ?rpart.object And noticed some inconsistencies, Some might be a mistake in the help file and some might be my misunderstanding. The help in the section: value -> frame (first paragraph), states that: > yval, the fitted value of the response at each node, *and splits, a two > column matrix of left and right split labels for each node. *
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 Dec 07
0
Are minbucket and minsplit rpart options working as expected?
Dear r-list: I am using rpart to build a tree on a dataset. First I obtain a perhaps too large tree: > arbol.bsvg.02 <- rpart(formula, data = bsvg, subset=grp.entr, control=rpart.control(cp=0.001)) > arbol.bsvg.02 n= 100000 node), split, n, loss, yval, (yprob) * denotes terminal node 1) root 100000 6657 0 (0.93343000 0.06657000) 2) meses_antiguedad_svg>=10.5 73899 3658
2007 Jun 15
2
method of rpart when response variable is binary?
Dear all, I would like to model the relationship between y and x. y is binary variable, and x is a count variable which may be possion-distribution. I think it is better to divide x into intervals and change it to a factor before calling glm(y~x,data=dat,family=binomail). I try to use rpart. As y is binary, I use "class" method and get the following result. >
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*`,
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 Mar 10
1
rpart returning only 1 node
Hi, This may actually be a theoretical question. When I tried to do the following: ########################################################## > colnames(rating.adclms) [1] "usage" "mileage" "sex" "excess" "ncd" [6] "primage" "minage" "drivers" "district" "cargroup" [11]
2012 May 15
2
rpart - predict terminal nodes for new observations
Dear useRs: Is there a way I could predict the terminal node associated with a new data entry in an rpart environment? In the example below, if I had a new data entry with an AM of 5, I would like to link it to the terminal node 2. My searches led to http://tolstoy.newcastle.edu.au/R/e4/help/08/07/17702.html but I do not seem to be able to operationalize Professor Ripley's suggestions. Many
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
2005 Jun 14
0
bug in rpart?
Dear R-helpers, Can you help me to see why "code 1" gives error while "code 2" runs fine? The only difference in the data is the distribution of age categories. I am attaching the session after the code. Many thanks. XL library(survival) library(rpart) # code 1 n <- 20 age <- rep(1:3, c(2, 3, 15)) eg<- data.frame(rexp(n), rbinom(n,1,prob=.3), age=age)
2003 Apr 10
1
Classification problem - rpart
I am performing a binary classification using a classification tree. Ironically, the data themselves are 2483 tree (real biological ones) locations as described by a suite of environmental variables (slope, soil moisture, radiation load, etc). I want to separate them from an equal number of random points. Doing eda on the data shows that there is substantial difference between the tree and random
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
2008 Jun 17
0
Rpart description of tree groups
I'm making a few functions to generate latex files describing rpart objects that are then \input-ed into a larger document. So far, the functions I have generate paragraphs containing enumerations of the predictors in pruned trees and the number of formed groups. Its easy enough to recover these. For instance, R> print ( tree ) n= 878 node), split, n, loss, yval, (yprob) *
2009 Aug 02
0
rpart: which is correct?
I am using rpart in classification mode and am confused about this particular model's predictions. > predict(fit, train[8,]) -1 1 8 0.5974089 0.4025911 > predict(fit, train[8,], type="class") 1 Levels: -1 1 So, it seems like there is a 60% change of being class -1 according the the "prob" output (which is the default for classification) but gives