Splits and Root node of binary decision tree(CART)

杀马特。学长 韩版系。学妹 提交于 2019-12-01 20:10:10

find the lables of that tree so that we can extract any of the vector

when the root node is character(ex.-A)

nodes<-labels(fit, digits=4, minlength=1L, pretty, collapse=TRUE)
root<-substr(nodes[2], 1, 1)

from the path we can extract the root node of a tree,below one is best to extract root node name by going through its second split which is nothing but an root node.

nodes<-labels(fit, digits=4, minlength=1L, pretty, collapse=TRUE)
path<-path.rpart(fit, node_no, pretty=0, print.it=FALSE) 
path[[2]][1]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!