Re: [R] Decision Trees RWeka

From: Achim Zeileis <Achim.Zeileis_at_wu-wien.ac.at>
Date: Tue, 17 Jun 2008 18:30:07 +0200 (CEST)

On Tue, 17 Jun 2008, strinz_at_freenet.de wrote:

> Hello,
>
> I have a question concerning decision
> trees coming from RWeka :
>
> library(RWeka)
> m =J48(Species~.,data=iris)
>
> How could such a decision tree be transferred
> into a matrix, pretty much in the same fashion,
> as it is done by getTree() in library(ofw)
>
> library(ofw)
> data(srbct)
> attach(srbct)
> ##ofwCART
> learn.cart.keep <- ofw(srbct, as.factor(class),type="CART", ntree=50, nforest=10, mtry=5)
> getTree(learn.cart.keep, k=3)
> detach(srbct)
>
> It would be very convenient to have
> a Weka Decision Tree object represented
> in matrix form or in y common binary tree format

Sure, that would be nice. However, we do not have a full R-representation of Weka_tree objects as we rely for almost all computations on the corresponding methods from Weka. For plotting we do some parsing of the representation (based on the DOT graph representation). Have a look at the output of

   RWeka:::make_Weka_classifier_tree(m)

hth,
Z

  Weka_tree objects is that RWeka
relies for almost all computations on the corresponding Weka methods and thus doesn't

> thanks a lot
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ______________________________________________
> R-help_at_r-project.org 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.
>
>



R-help_at_r-project.org 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 Tue 17 Jun 2008 - 16:54:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 17 Jun 2008 - 17:30:46 GMT.

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

list of date sections of archive