quinta-feira, 19 de março de 2015

Growing some Trees

http://ift.tt/1BZrPMW

Consider here the dataset used in a previous post, about visualising a classification (with more than 2 features), > MYOCARDE=read.table( + "http://ift.tt/1Ew09Qc;, + header=TRUE,sep=";") The default classification tree is > arbre = rpart(factor(PRONO)~.,data=MYOCARDE) > rpart.plot(arbre,type=4,extra=6) We can change the options here, such as the minimum number of observations, per node > arbre = rpart(factor(PRONO)~.,data=MYOCARDE, + control=rpart.control(minsplit=10)) > rpart.plot(arbre,type=4,extra=6) or > arbre = rpart(factor(PRONO)~.,data=MYOCARDE, + control=rpart.control(minsplit=5)) > rpart.plot(arbre,type=4,extra=6) To visualize that classification, use the following code (to get a projection on the first two components) … Continue reading Growing some Trees

from R-bloggers http://ift.tt/xdvlrq

Nenhum comentário:

Postar um comentário

Leave your comment here!