Question

I have 4 groups: sensitivity, category, extent, duration. Each of these 4 have 4 levels. Sensitivity - A, B, C, D Category - 1, 2, 3, 4 Extent - site, local, regional, pan-regional Duration - short-term, medium-term, long-term, irreversible

I use a combination of these (there are 256 total) to get a severity classification. There are 7 severity classes: S1, S2, S3, S4, S5, S6, N.

Using RPART, I get a tree that has Duration=cd as the first binary break. Then the next one on the left side of the tree is Sensitivity=ab. How do I know which duration levels c and d are? And how do I know which sensitivity levels a and b are?

Thanks!

Was it helpful?

Solution

Does using print() give you what you're after? This prints a list of nodes in the model and then the variables at each.

rpartmodel <- rpart(Price ~ Country + Mileage + Type, data =  car.test.frame)

print(rpartmodel)

Alternatively try plotting your tree using the rpart.plot package?

library(rpart.plot)

prp(rpartmodel, faclen = 9)

More customization of the plots (I find) and it labels splits with the names of categories. faclen above controlling the number of characters shown for factor splits.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top