[R] rpart output: rule extraction beyond path.rpart()

From: Bryant, Benjamin <bryant_at_prgs.edu>
Date: Wed 23 Aug 2006 - 08:46:20 EST

 

Greetings -  

Is there a way to automatically perform what I believe is called "rule extraction" (by Quinlan and the machine learning community at least) for the leaves of trees generated by rpart? I can use path.rpart() to automatically extract the paths to the leaves, but these can be needlessly cumbersome. For example, one path returned by path.rpart() might be:  

[1] "root" "y>=-0.1905" "y< 0.1495" "z>=-0.19" "z< 0.1785"

[6] "y>=-0.1385" "z>=-0.153" "x< 0.37" "x>=-0.363"
 

But the y >= -0.1905 and z>=-.19 are both redundant, given restrictions placed further down the tree. Simplifying the paths by hand is feasible for small trees but quite cumbersome when dimensionality increases. I can think of ways to write code to do this automatically, but would prefer not to if it's already implemented. I have done extensive searching and turned up nothing, but I fear I might just be lacking the right terminology. Any thoughts?  

Much appreciated,

-Ben  

Ben Bryant

Doctoral Fellow

Pardee RAND Graduate School

bryant@prgs.edu    


This email message is for the sole use of the intended recip...{{dropped}}



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 23 08:55:30 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 23 Aug 2006 - 10:21:43 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.