similar to: Finding a decision tree's leaf node from a new value

Displaying 20 results from an estimated 7000 matches similar to: "Finding a decision tree's leaf node from a new value"

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
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
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 Apr 08
4
Rpart decision tree
Dear useRs: I try to plot an rpart object but cannot get a nice tree structure plot. I am using plot.rpart and text.rpart (please see below) but the branches that connect the nodes overlap the text in the ellipses and rectangles. Is there a way to get a clean nice tree plot (as in the Rpart Mayo report)? I work under Windows and use R2.11.1 with rpart version 3.1-46. Thank you. Tudor ...
2004 Sep 03
2
windowing strategies
Hello to everybody, Does anyone has implemented a function for evaluating models using windowing strategies, such as growing window or sliding window ones? The aim is to evaluate regression models on a time series data. I do not use cross-validation once data sorted in a radom way does not make sense when evaluating time series. Thanks Joao Moreira
2003 Jun 04
2
plot rpart tree's from list object
Hello, i want the post plot's from a rpart list object with 18 tree's , getting no error - but getting no files,too? Perhaps i should using assign!? for (i in 1:length(treeList)) { post(treeList[[i]],filename=paste("Tree","i",sep=".ps"), title="Arbeitszufriedenheit", digits=getOption("digits") - 0,use.n=TRUE) } many thanks for help,
2011 Nov 04
1
Decision tree model using rpart ( classification
Hi Experts, I am new to R, using decision tree model for getting segmentation rules. A) Using behavioural data (attributes defining customer behaviour, ( example balances, number of accounts etc.) 1. Clustering: Cluster behavioural data to suitable number of clusters 2. Decision Tree: Using rpart classification tree for generating rules for segmentation using cluster number(cluster id) as target
2012 Mar 05
1
decision/classification trees with fewer than 20 objects
Hi! I'm trying to construct and plot a decision tree to class a set of only 8 objects and tried to use the rpart and tree function, but get a error message both times: rpart: fit is not a tree, just a root tree: cannot plot singlenode tree I read in the post 'question regression trees' that rpart doesn't split a set of fewer than 20 objects...so I guess the same holds true for
2005 Aug 26
2
learning decision trees with one's own scoring functins
Hi netters, I want to learn a decision tree from a series of instances (learning data). The packages tree or rpart can do this quite well, but the scoring functions (splitting criteria) are fixed in these packages, like gini or something. However, I'm going to use another scoring function. At first I wanna modify the R code of tree or rpart and put my own scoring function in. But it
2010 Aug 13
1
decision tree finetune
My decision tree grows only with one split and based on what I see in E-Miner it should split on more variables. How can I adjust splitting criteria in R? Also is there way to indicate that some variables are binary, like variable Info_G is binary so in the results would be nice to see "2) Info_G=0" instead of "2) Info_G<0.5". Thank you in advance! And thanks for Eric who
2004 Oct 29
1
Giving column names to a matrix
Heloo, I have the following problem: orig.data <- NULL Inside a loop I have instructions like: orig.data <- rbind(orig.data, ...) After that I do: colnames(orig.data)<-c('Data','InicioViagem', ...) Everything works fine. For example, the first line of the matrix is: > orig.data[1,] Data InicioViagem ... 1 40466 ... The problem is: I
2005 Aug 14
1
How to add decision trees into a list?
Hi, I am somewhat new to R so this question may be foolish, but is it possible to add decision trees into a list, array or vector in R? I am trying to build a collection (ensemble) of decision trees. Every time a new instance arrive I need to get the prediction of each decision tree. I have tried to add a decision tree into a variable but without luck. Is a special package needed perhaps? This
2010 Jul 22
1
decision tree with weighted inputs
I'd like to train a decision tree on a set of weighted data points. I looked into the rpart package, which builds trees but doesn't seem to offer the capability of weighting inputs. (There is a weights parameter, but it seems to correspond to output classes rather than to input points). I'm making do for now by preprocessing my input data by adding multiple instances of each data
2004 Nov 08
2
Converting strings to date
Hello, I have the following problem: test is a data frame with 9 fields. The field test$Date is factorized with dates. The format is dd-mm-yyyy (using Oracle notation). I want to convert this to Date in '%Y-%m-%d format. What I am doing is: for (i in 1:nrow(test)) { test[i,]$Data<-strptime(substring(test[i,]$Data,1,10),"%d-%m-%Y") } test is a data frame. The error is:
2009 Nov 24
1
Decision trees with factors and numericals
Hi all, Does any of you know how to make a decision tree when the data set contains factors and numericals? I've got a data frame with 3 columns, where y and x1 are numerical and x2 contains factors. Is it possible to use the rpart package, and in that case how? Otherwise, is there another alternative? This is what I've tried so far > rpart(LT50_NA ~ Raf + Antho,
2010 Sep 04
1
Decision Tree in Python or C++?
Have anybody used Decision Tree in Python or C++? (or written their own decision tree implementation in Python or C++)? My goal is to run decision tree on 8 million obs as training set and score 7 million in test set. I am testing 'rpart' package on a 64-bit-Linux + 64-bit-R environment. But it seems that rpart is either not stable or running out of memory very quickly. (Is it
2005 Apr 26
3
Error using e1071 svm: NA/NaN/Inf in foreign function call
Hello, As far I saw in archive mailing list, I am not the first person with this problem. Anyway I was not able to pass this error once the information I got from the archive it is not very conclusive for this case. I have used linear, radial and sigmoid kernels for the same data in the same conditions and everything is ok. This problem just happens with the polynomial kernel. I send the
2010 May 11
1
how to extract the variables used in decision tree
HI, Dear R community, How to extract the variables actually used in tree construction? I want to extract these variables and combine other variable as my features in next step model building. > printcp(fit.dimer) Classification tree: rpart(formula = outcome ~ ., data = p_df, method = "class") Variables actually used in tree construction: [1] CT DP DY FC NE NW QT SK TA WC WD WG WW
2005 Jun 21
1
Data.frames with different line's length
Hello, I want to create a data.frame with different number of columns per line. What I want is something like: example <- NULL begin <- 1 while (end < nrow(orig.data)) { end <- next.day(orig.data,begin) # my own function. It returns the first index from the next day. Each day has a different number of records. example <- rbind(example, c(begin, end, predictions[c(begin:end)],
2004 Mar 08
3
Decision Trees
I am familiar with the rpart and tree packages for classification and regression trees. However, quite a bit of the research in the transportation community relating to decision trees uses the C4.5 family of algorithms by Quinlan. Are there any plans to make a C4.5 (or a derivative of it) available to R? If not, then I might use the WEKA Java package ( http://www.cs.waikato.ac.nz/ml/weka) that