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 in the rpart result.
How can I solve this?
fm.pipe<-Leakage~PipeAge +PipePressure
> printcp(CART.fit)
Regression tree:
rpart(formula = fm.pipe, data = Data)
Variables actually used in tree construction:
character(0)
Root node error: 299.84/569378 = 0.00052661
n= 569378
CP nsplit rel error xerror xstd
1 0.0033246 0 1 0 0
See Question&Answers more detail:os