Friday, 15 April 2011

r - cart with rpart not displaying entire plot -



r - cart with rpart not displaying entire plot -

i trying plot classification tree using rpart, , r isn't including of variables. have 20 cases, , 200 variables. info looks this:

data <- data.frame(y = c(rep(0, 10), rep(1, 10)), x1 = c(rnorm(20)), x2 = c(rnorm(20)+0.5), x3 = c(rnorm(20)-0.2))

but x1 + x2 +x3 .... + x200.

all of variable values similar this; small, averaging around 0.0005.i need classification tree, , y binary, want method = "class" :

cart <- rpart(formula = y ~ ., info = data, method = "class")

when type

print(cart)

i get:

n= 20 node), split, n, deviance, yval * denotes terminal node 1) root 20 5.958333 0.4583333 2) x50< 0.0005126315 16 2.437500 0.1875000 * 3) x50>=0.0005126315 8 0.000000 1.0000000 *

i'm not sure why it's splitting according x50. tried plotting see going on, , when did

plot(cart)

i got next plot: http://i.imgur.com/ccta69a.png

any thought what's going on, or how can prepare this? much appreciated.

r plot classification cart rpart

No comments:

Post a Comment