similar to: rpart: how to assign observations to nodes in regression trees

Displaying 20 results from an estimated 10000 matches similar to: "rpart: how to assign observations to nodes in regression trees"

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
2001 Jul 02
1
text.rpart: Unwanted NA labels on terminal nodes (PR#1009)
Brian The following (which is new to rw1030) occurs with both Windows 98 & Windows ME. I have not tested behaviour under Unix or Linux, but I expect it is no different. text.rpart() prints unwanted NAs (presumably in the splitting criterion position) on terminal nodes. Criterion <- factor(paste("Leaf", 1:5)) Node <- factor(1:5)
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
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?
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
2012 Jul 06
2
Plotting rpart trees with long list of class members
I have a class with 732 members, so using rpart.plot is giving me a tiny plot in the middle of the window. Is there a good way to modify the plot, or replace the long list with something like "group1"? -- View this message in context: http://r.789695.n4.nabble.com/Plotting-rpart-trees-with-long-list-of-class-members-tp4635671.html Sent from the R help mailing list archive at
2011 Mar 23
2
predict.rpart help
Hi Everyone, Is there a way to get predict.rpart() to return the nodes reached by the new examples in addition to the predicted probabilities it already returns? In other words, I would like to know the leaf node in the tree object that each new example data drops down to. Thanks in advance for your help. Osei
2011 Sep 08
1
"rpart" or "tree" function issue
I am trying to create a classification tree using either tree or rpart functions but when it comes to plotting the results the formatting I get is different than what I see in all the tutorials (like http://www.youtube.com/watch?v=9XNhqO1bu0A or http://www.youtube.com/watch?v=m3mLNpeke0I&feature=related or http://www.statmethods.net/advstats/cart.html "tree for kyphosis"). I am
2010 Apr 12
1
rpart: Writing values of the leaves to a dateset
I'm fitting a regression tree with rpart and I want to write the values for every leaf in a dataset. As an example take the variable turnover. Let's suppose my tree for turnover has 30 leaves and I want to have 30 datasets with dataset 1 containing the turnover values of the units in leaf 1, dataset 2 containing turnover values for the observations in leaf 2 and so on. How can I do
2005 Sep 09
1
Finding a decision tree's leaf node from a new value
Dear mailinglist members, I have the following problem: I run a decision tree using the rpart function and, afterwords, I try to find to which leaf node a new register (not used to build the decision tree) belongs to. I will try to explain better: rpart.tree <- rpart(target.value ~., data) leaf.node <- new.function(rpart.tree, new.register) The new register has all the explanatory values
2004 Mar 19
2
How to collect trees grown by rpart
Jonathan, Try making a list instead of an array. See ?list. Also, did you look into random forests? I'm not sure what you want to do, but there might be methods there to do some of the work for you. Sean On 3/19/04 1:12 PM, "Jonathan Williams" <jonathan.williams at pharmacology.oxford.ac.uk> wrote: > I would like to collect the trees grown by rpart fits in an array,
2007 Mar 30
2
Minimum valid number of observations for rpart
Hi, I wonder if anyone knows a study dealing with the minimum valid number of observations when using CART?. On top of that, when using RandomForest, is it possible to obtained a interpretable tree model as the graphical output of the analysis, just like in "rpart"? Thanks a lot in advance Javier Lozano Universidad de Le?n Spain
2003 Jul 17
1
Rpart question - labeling nodes with something not in x$frame
I have a tree created with tr.hh.logcas <- rpart(log(YCASSX + 1)~AGE+DRUGUSEY+SEX+OBSXNUM +WINDLE, xval = 10) I would like to label the nodes with YCASSX rather than log(YCASSX + 1). But the help file for text in library rpart says that you can only use labels that are part of x$frame, which YCASSX is not. Is there a way to do what I want? Thanks in advance Peter Peter L. Flom, PhD
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
2007 Feb 26
2
survival analysis using rpart
Hello, I use rpart to predict survival time and have a problem in interpreting the output of ?estimated rate?. Here is an example of what I do: > stagec <- > read.table("http://www.stanford.edu/class/stats202/DATA/stagec.data", > col.names=c("pgtime", "pgstat", "age","eet", "g2", "grade", "gleason", >
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
2008 Dec 17
1
pruning trees using rpart
Hi, I am using the packages tree and rpart to build a classification tree to predict a 0/1 outcome. The package rpart has the advantage that the function plotcp gives a visual representation of the cross-validation results with a horizontal line indicating the 1 standard error rule, i.e. the recommendation to select the most parsimonious model (the smallest tree) whose error is not more than one
2012 Mar 04
1
rpart package, text function, and round of class counts
I run the following code: library(rpart) data(kyphosis) fit <- rpart(Kyphosis ~ ., data=kyphosis) plot(fit) text(fit, use.n=TRUE) The text labels represent the count of each class at the leaf node. Unfortunately, the numbers are rounded and in scientific notation rather than the exact number of examples sorted by that node in each class. The plot is supposed to look like
2012 Sep 21
1
prune in rpart: choose number terminal nodes
Dear community, I've an rpart object, and I know the CP I want. I'd like to know if it's possible also to fix the number of terminal nodes I want. Thanks in advance, user at host.com as user at host.com -- View this message in context: http://r.789695.n4.nabble.com/prune-in-rpart-choose-number-terminal-nodes-tp4643837.html Sent from the R help mailing list archive at