r - IDing levels in RPART output -


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 combination of these (there 256 total) severity classification. there 7 severity classes: s1, s2, s3, s4, s5, s6, n.

using rpart, tree has duration=cd first binary break. next 1 on left side of tree sensitivity=ab. how know duration levels c , d are? , how know sensitivity levels , b are?

thanks!

does using print() give you're after? prints list of nodes in model , variables @ each.

rpartmodel <- rpart(price ~ country + mileage + type, data =  car.test.frame)  print(rpartmodel) 

alternatively try plotting tree using rpart.plot package?

library(rpart.plot)  prp(rpartmodel, faclen = 9) 

more customization of plots (i find) , labels splits names of categories. faclen above controlling number of characters shown factor splits.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -