Re: How to make unpruned tree using J48?

716 views
Skip to first unread message

Christopher Beckham

unread,
Mar 30, 2015, 7:14:10 PM3/30/15
to python-we...@googlegroups.com
http://weka.sourceforge.net/doc.dev/weka/classifiers/trees/J48.html

Just use the parameters that deal with unpruned trees, e.g. -U and -S. So do something like:

cls = Classifier(classname="weka.classifiers.trees.J48", options=["-C", "0.3", "-U", "-S"])

 Hopefully that works anyway... it's been a while since I've used the wrapper.

Cheers

On Tue, Mar 31, 2015 at 12:03 PM, Sekti Wicaksono <sektiwi...@gmail.com> wrote:
Sir i wanna know it's possible to make unpruned tree J48, how i can edit this code to make unpruned tree?

cls = Classifier(classname="weka.classifiers.trees.J48", options=["-C", "0.3"])

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To post to this group, send email to python-we...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/42e89503-7a6a-4245-ae66-1d300288e7f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Peter Reutemann

unread,
Mar 30, 2015, 7:52:36 PM3/30/15
to python-weka-wrapper
> That code give me this error sir
> javabridge.jutil.JavaException: Subtree raising doesn't need to be unset for
> unpruned tree!
>
> if i'm using
> cls = Classifier(classname="weka.classifiers.trees.J48", options=["-C",
> "0.3", "-U"])
>
> will give me this error
> javabridge.jutil.JavaException: Doesn't make sense to change confidence for
> unpruned tree!
>
> But if i using default confidenceFactor = 0.25
> cls = Classifier(classname="weka.classifiers.trees.J48", options=["-U"])
>
> it's working. Looks like i can't set confidenceFactor to 0.3 to use unpruned
> tree sir.

These errors are correct, as pruning requires the confidence factor
(-C), but it doesn't make sense setting it when you want an unpruned
tree. So simply use "-U" by itself if you want an unpruned tree.

Cheers, Peter
--
Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ
http://www.cms.waikato.ac.nz/~fracpete/ Ph. +64 (7) 858-5174
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages