I am working on a project at my work place and I am running into some
issues with my decision tree analysis. THIS IS NOT A HOMEWORK ASSIGNMENT.
Sample dataset
PRODUCT_SUB_LINE_DESCR MAJOR_CATEGORY_DESCR CUST_REGION_DESCR
SUNDRYSMALL EQUIP NORTH EAST
h
>> >> decision rules "clusters" and probability attached to them. The
>> examples
>> >> are sort of similar. You just provided links to general info about
>> trees.
>> >>
>> >>
>> >>
>> >> Sent from my Verizon, Samsung Galaxy smartpho
neral info about
> trees.
> >>
> >>
> >>
> >> Sent from my Verizon, Samsung Galaxy smartphone
> >>
> >>
> >> Original message
> >> From: Sarah Goslee
> >> Date: 4/13/16 8:04 PM (GMT-06:00)
> >> To: Micha
ed to them. The examples
>> are sort of similar. You just provided links to general info about trees.
>>
>>
>>
>> Sent from my Verizon, Samsung Galaxy smartphone
>>
>>
>> Original message
>> From: Sarah Goslee
>> Date: 4/13/
>
>
> Original message
> From: Sarah Goslee >
> Date: 4/13/16 8:04 PM (GMT-06:00)
> To: Michael Artz >
> Cc: "r-help@r-project.org
> " <
> R-help@r-project.org
> >
> Subject: Re: [R] Decision Tree and Random Forrest
>
>
&g
On Thu, 14 Apr 2016, Michael Artz wrote:
Ah yes I will have to use the predict function. But the predict function
will not get me there really. If I can take the example that I have a
model predicting whether or not I will play golf (this is the dependent
value), and there are three independen
- Original message
From: Sarah Goslee Date:
4/13/16 8:04 PM (GMT-06:00) To: Michael Artz
Cc: "r-help@r-project.org"
Subject: Re: [R] Decision Tree and Random
Forrest
On Wednesday, April 13, 2016, Michael Artz wrote:
> Tjats great that you are familiar and thanks fo
On Wednesday, April 13, 2016, Michael Artz wrote:
> Tjats great that you are familiar and thanks for responding. Have you
> ever done what I am referring to? I have alteady spent time going through
> links and tutorials about decision trees and random forrests and have even
> used them both befo
Tjats great that you are familiar and thanks for responding. Have you ever
done what I am referring to? I have alteady spent time going through links
and tutorials about decision trees and random forrests and have even used
them both before.
Mike
On Apr 13, 2016 5:32 PM, "Sarah Goslee" wrote:
I
It sounds like you want classification or regression trees. rpart does
exactly what you describe.
Here's an overview:
http://www.statmethods.net/advstats/cart.html
But there are a lot of other ways to do the same thing in R, for instance:
http://www.r-bloggers.com/a-brief-tour-of-the-trees-and-fo
Ah yes I will have to use the predict function. But the predict function
will not get me there really. If I can take the example that I have a
model predicting whether or not I will play golf (this is the dependent
value), and there are three independent variables Humidity(High, Medium,
Low), Pen
I think you are missing the point of random forests. But if you just
want to predict using the forest, there is a predict() method that you
can use. Other than that, I certainly don't understand what you mean.
Maybe someone else might.
Cheers,
Bert
Bert Gunter
"The trouble with having an open m
Also that being said, just because random forest are not the same thing as
decision trees does not mean that you can't get decision rules from random
forest.
On Wed, Apr 13, 2016 at 4:11 PM, Michael Artz
wrote:
> Ok is there a way to do it with decision tree? I just need to make the
> decision
Ok is there a way to do it with decision tree? I just need to make the
decision rules. Perhaps I can pick one of the trees used with Random
Forrest. I am somewhat familiar already with Random Forrest with
respective to bagging and feature sampling and getting the mode from the
leaf nodes and it
Nope.
Random forests are not decision trees -- they are ensembles (forests)
of trees. You need to go back and read up on them so you understand
how they work. The Hastie/Tibshirani/Friedman "The Elements of
Statistical Learning" has a nice explanation, but I'm sure there are
lots of good web resou
Hi I'm trying to get the top decision rules from a decision tree.
Eventually I will like to do this with R and Random Forrest. There has to
be a way to output the decsion rules of each leaf node in an easily
readable way. I am looking at the randomforrest and rpart packages and I
dont see anything
)
> To: r-help@r-project.org
> Subject: [R] Decision tree in R using csv files
>
> Hi
> Pls check the attachment. I am having some error while making a decision
> tree in R . Pls help.
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com
Hi
Pls check the attachment. I am having some error while making a decision
tree in R . Pls help.
--
View this message in context:
http://r.789695.n4.nabble.com/Decision-tree-in-R-using-csv-files-tp4708193.html
Sent from the R help mailing list archive at Nabble.com.
___
It is box.col= in prp().
fancyRpartPlot() in Rattle currently uses a fixed colour palette (something
I should change).
You could change it in a local copy of the fancyRpartPlot() code (see the
line defining pals in the function):
> fancyRpartPlot
I also give an example around page 33 of the Dec
Hi Jean,
I'd looked at the help for 'prp' but couldn't find the argument for
changing box colours. Am I missing something?
On Thu, Jul 10, 2014 at 8:01 PM, Adams, Jean wrote:
> The function fancyRpartPlot() is actually in the rattle package, and it is
> a wrapper for the prp() function in the
The function fancyRpartPlot() is actually in the rattle package, and it is
a wrapper for the prp() function in the rpart.plot package. If you look at
the help for prp(), you should be able to see how to change the color.
library(rpart.plot)
?prp
Jean
On Thu, Jul 10, 2014 at 12:34 AM, Abhinaba
Hi R-helpers,
Is it possible to change the color of the boxes when plotting decision
trees using 'fancyRpartPlot()' from rpart.plot package ?
--
Regards,
Abhinaba Roy
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
h
Vik,
On Fri, Sep 21, 2012 at 12:42 PM, Vik Rubenfeld wrote:
> Max, I installed C50. I have a question about the syntax. Per the C50 manual:
>
> ## Default S3 method:
> C5.0(x, y, trials = 1, rules= FALSE,
> weights = NULL,
> control = C5.0Control(),
> costs = NULL, ...)
>
> ## S3 method for class
My pleasure. As a part of R team we are always here to help each other.
Best Regards,
Bhupendrasinh Thakre
Sent from my iPhone
On Sep 22, 2012, at 1:46 PM, Vik Rubenfeld wrote:
> Bhupendrashinh, thanks again for telling me about RWeka. That made a big
> difference in a job I was working on
Bhupendrashinh, thanks again for telling me about RWeka. That made a big
difference in a job I was working on this week.
Have a great weekend.
-Vik
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Max, I installed C50. I have a question about the syntax. Per the C50 manual:
## Default S3 method:
C5.0(x, y, trials = 1, rules= FALSE,
weights = NULL,
control = C5.0Control(),
costs = NULL, ...)
## S3 method for class ’formula’
C5.0(formula, data, weights, subset,
na.action = na.pass, ...)
I b
There is also C5.0 in the C50 package. It tends to have smaller trees that C4.5
and much smaller trees than J48 when there are factor predictors. Also, it has
an optional feature selection ("winnow") step that can be used.
Max
On Sep 21, 2012, at 2:18 AM, Achim Zeileis wrote:
> Hi,
>
> just
Hi,
just to add a few points to the discussion:
- rpart() is able to deal with responses with more than two classes.
Setting method="class" explicitly is not necessary if the response is a
factor (as in this case).
- If your tree on this data is so huge that it can't even be plotted, I
woul
Very good. Could you point me in a couple of potential directions for variable
reduction? E.g. correlation analysis?
On Sep 20, 2012, at 10:36 PM, Bhupendrasinh Thakre wrote:
> One possible way to think of it is using " variable reduction" before going
> for J48. You may want to use several m
One possible way to think of it is using " variable reduction" before going for
J48. You may want to use several methods available for that. Again prediction
for brands is more of a business question to me.
Two solution which I can think of.
1. Variable reduction before decision tree.
2. Let th
Bhupendrashinh, thanks very much! I ran J48 on a respondent-level data set and
got a 61.75% correct classification rate!
Correctly Classified Instances 988 61.75 %
Incorrectly Classified Instances 612 38.25 %
Kappa statistic
Thanks! Here's the dput output:
> dput(test.df)
structure(list(BRND = structure(c(1L, 12L, 16L, 17L, 18L, 19L,
20L, 21L, 22L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 13L,
14L, 15L), .Label = c("Brand 1", "Brand 10", "Brand 11", "Brand 12",
"Brand 13", "Brand 14", "Brand 15", "Brand 16", "Bran
Not very sure what the problem is as I was not able to take your data for run.
You might want to use dput() command to present the data.
Now on the programming side. As we can see that we have more than 2 levels for
the brands and hence method = class is not able to able to understand what you
I'm working with some data from which a client would like to make a decision
tree predicting brand preference based on inputs such as price, speed, etc.
After running the decision tree analysis using rpart, it appears that this data
is not capable of predicting brand preference.
Here's the d
aajit75 yahoo.co.in> writes:
> fit <- rpart(decile ~., method="class",
> control=rpart.control(minsplit=min_obs_split, cp=c_c_factor),
> data=dtm_ip)
>
> In A and B target variable 'segment' is from the clustering data using same
> set of input variables , while in C target va
Could you please repeat the error massage you get for C ?
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (Engli
Hi,
Thanks for the responce, code for each case is as:
c_c_factor <- 0.001
min_obs_split <- 80
A)
fit <- rpart(segment ~., method="class",
control=rpart.control(minsplit=min_obs_split, cp=c_c_factor),
data=Beh_cluster_out)
B)
fit <- rpart(segment ~., method="class",
Hi Ajit,
Please send the code you are running in each case.
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (Engl
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
As I am only familiar with the basics regarding decision trees I would
like to ask, with the risk of sating a silly question: is it possible
to perform recursive partitioning with the group median as the
response/objective?
For example, in stead of rpart focusing on means, could a similar tree
be
If you are talking about an rpart object you are going to plot, see
?plot.rpart
and
?text.rpart
Uwe Ligges
On 19.08.2010 23:10, Olga Shaganova wrote:
I am using "plot" and "text" commands to display the decision tree I built,
here is the code:
plot(fit, compress=TRUE)
text(fit, use.n=T
c: r-help@r-project.org
> Subject: Re: [R] Decision Tree in Python or C++?
>
> for python, please check
> http://onlamp.com/pub/a/python/2006/02/09/ai_decision_trees.html
>
> On Sat, Sep 4, 2010 at 11:21 AM, noclue_ wrote:
> >
> >
> > Have anybody used Decisi
for python, please check
http://onlamp.com/pub/a/python/2006/02/09/ai_decision_trees.html
On Sat, Sep 4, 2010 at 11:21 AM, noclue_ wrote:
>
>
> 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
>
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
I am using "plot" and "text" commands to display the decision tree I built,
here is the code:
plot(fit, compress=TRUE)
text(fit, use.n=TRUE)
but the the result of this code is not readable. Text doesn't get fully
displayed (missing on the margines and overlapping in the middle). Where
can I get
I figured it out myself, here it is: control=rpart.control(cp=.001))
Thank you!
On Fri, Aug 13, 2010 at 12:58 PM, Olga Shaganova wrote:
> 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
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=
Hi,
In the R-Help history there have been similar questions to yours. As a
starting point you can check this:
http://tolstoy.newcastle.edu.au/R/e2/help/07/01/9138.html
Regrads,
Carlos.
On Thu, Jul 22, 2010 at 6:37 PM, David Shin wrote:
> I'd like to train a decision tree on a set of weighted
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 m
49 matches
Mail list logo