The result of rpart is just with 1 root

后端 未结 3 668
孤城傲影
孤城傲影 2020-12-09 16:57

As in my dataset ,the Leakage have two value 1,0. There are just about 300 rows with 1 and extra in 569378 rows are with 1. This would be the reason that I just got 1 root i

3条回答
  •  隐瞒了意图╮
    2020-12-09 17:49

    There may not be a way to "solve" this, if the independent variables do not provide enough information to grow the tree. See, for example, the help for rpart.control: "Any split that does not decrease the overall lack of fit by a factor of cp is not attempted." You could try loosening the control parameters, but there's no guarantee that will result in the tree growing beyond a root.

    CART.fit <- rpart(formula=fm.pipe, data=Data, control=rpart.control(minsplit=2, minbucket=1, cp=0.001))
    

提交回复
热议问题