[R] How to interactively create manually guided Decision Tree
Bert Gunter
gunter.berton at gene.com
Fri Jun 14 18:18:15 CEST 2013
You need to do some reading, both about decision trees and R!
What you need to do for R is to use cut() on Age (?cut) to create a
new categorical variable, ageCat, say, and then use that in your tree
building instead of Age.
Cheers,
Bert
On Fri, Jun 14, 2013 at 7:24 AM, Neelesh Gupta <neelesh0 at gmail.com> wrote:
> I am new in using R. I want to know all about building decision tree model
> in R.
> Few options which I searched are rpart and rattle to build a decision
> tree.Both the functions are giving me splits which are statistically
> appropriate.
>
> But I am not able to figure out how to change those splits as per my
> business requirement.
>
> for example : the automatic split of Age by using rattle is > 30 and <= 30
> but I want a split of <= 20 , 21-30 , 30-50 and >= 50
>
> I also want to know how to know the predictive strength of each variable
> after each split so that I can choose which variable should come next in my
> list.
>
> I
>
> Thanks in advance
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Bert Gunter
Genentech Nonclinical Biostatistics
Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
More information about the R-help
mailing list