Export/save J48 tree

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Export/save J48 tree

Φερετζάκης Γεώργιος

Hello,

I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.

I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.

Is there any other way to export/save the weka trees?


Thank you very much!


George Feretzakis


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Eibe Frank-2
Administrator
It would be useful if you could post the error messages you get from using

 graphviz-treevisualize-weka-package

I’m currently having trouble using GraphViz on my Mac. Are you using a Mac by any chance?

For high-quality output, the dot language is indeed a good option. If the package doesn’t work for you, you will have to do things manually (and you still need to get GraphViz to work).

Unfortunately, there is no option in the GUI to output the tree in .dot format. This can only be done with the WEKA command-line interface at the moment.

Here is what you can do:

a) Right-click on the entry in the “Result list” and choose “Save model”.

b) Use something like “my_j48_tree” as the filename (“.model” will be appended). Save the model in your home folder.

c) Enter the following command-line to generate dot output in a console:

  java weka.Run .J48 -l my_j48_tree.model -g -T <complete file name of your dataset > my_j48_tree.dot

This will save the description of the tree in the dot language in the file my_j48_tree.dot. (The -T option with the file name has no effect but is currently necessary, unfortunately.)

In theory, you can then process that file with the dot command from GraphViz. On the web, there is http://www.webgraphviz.com/

Cheers,
Eibe

PS:

Another really nice option is to run J48 in R, using the RWeka package in R. The partykit package for R can produce fantastic tree visualisations, e.g.:

  https://stackoverflow.com/questions/33458754/understanding-partykit-graph-out-of-j48-in-r


> On 5/02/2019, at 7:13 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
>
> Hello,
> I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.
> I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.
> Is there any other way to export/save the weka trees?
>
> Thank you very much!
>
> George Feretzakis
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Φερετζάκης Γεώργιος
Eibe,
Thank you very much for your detailed response. I'll try all of your proposed solutions and if it is needed I'll come back.

Thanks again!

George

From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
Sent: Wednesday, February 6, 2019 1:36:26 AM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
It would be useful if you could post the error messages you get from using

 graphviz-treevisualize-weka-package

I’m currently having trouble using GraphViz on my Mac. Are you using a Mac by any chance?

For high-quality output, the dot language is indeed a good option. If the package doesn’t work for you, you will have to do things manually (and you still need to get GraphViz to work).

Unfortunately, there is no option in the GUI to output the tree in .dot format. This can only be done with the WEKA command-line interface at the moment.

Here is what you can do:

a) Right-click on the entry in the “Result list” and choose “Save model”.

b) Use something like “my_j48_tree” as the filename (“.model” will be appended). Save the model in your home folder.

c) Enter the following command-line to generate dot output in a console:

  java weka.Run .J48 -l my_j48_tree.model -g -T <complete file name of your dataset > my_j48_tree.dot

This will save the description of the tree in the dot language in the file my_j48_tree.dot. (The -T option with the file name has no effect but is currently necessary, unfortunately.)

In theory, you can then process that file with the dot command from GraphViz. On the web, there is http://www.webgraphviz.com/

Cheers,
Eibe

PS:

Another really nice option is to run J48 in R, using the RWeka package in R. The partykit package for R can produce fantastic tree visualisations, e.g.:

  https://stackoverflow.com/questions/33458754/understanding-partykit-graph-out-of-j48-in-r


> On 5/02/2019, at 7:13 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
>
> Hello,
> I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.
> I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.
> Is there any other way to export/save the weka trees?
>
> Thank you very much!
>
> George Feretzakis
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Φερετζάκης Γεώργιος
In reply to this post by Eibe Frank-2

Hello Eibe,

I tried to apply your proposed solution for exporting the weka tree output either to .dot or to .png file but unfortunately didn't work in windows.

I attach the directory which is located the WEKA.

and the output of the command line of windows 10


I need the outputs in high-quality images for paper submission to a Journal with the appropriate reference to your software.


Thank you very much for your help.


Kind regards


George


From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
Sent: Wednesday, February 6, 2019 1:36:26 AM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
It would be useful if you could post the error messages you get from using

 graphviz-treevisualize-weka-package

I’m currently having trouble using GraphViz on my Mac. Are you using a Mac by any chance?

For high-quality output, the dot language is indeed a good option. If the package doesn’t work for you, you will have to do things manually (and you still need to get GraphViz to work).

Unfortunately, there is no option in the GUI to output the tree in .dot format. This can only be done with the WEKA command-line interface at the moment.

Here is what you can do:

a) Right-click on the entry in the “Result list” and choose “Save model”.

b) Use something like “my_j48_tree” as the filename (“.model” will be appended). Save the model in your home folder.

c) Enter the following command-line to generate dot output in a console:

  java weka.Run .J48 -l my_j48_tree.model -g -T <complete file name of your dataset > my_j48_tree.dot

This will save the description of the tree in the dot language in the file my_j48_tree.dot. (The -T option with the file name has no effect but is currently necessary, unfortunately.)

In theory, you can then process that file with the dot command from GraphViz. On the web, there is http://www.webgraphviz.com/

Cheers,
Eibe

PS:

Another really nice option is to run J48 in R, using the RWeka package in R. The partykit package for R can produce fantastic tree visualisations, e.g.:

  https://stackoverflow.com/questions/33458754/understanding-partykit-graph-out-of-j48-in-r


> On 5/02/2019, at 7:13 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
>
> Hello,
> I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.
> I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.
> Is there any other way to export/save the weka trees?
>
> Thank you very much!
>
> George Feretzakis
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Eibe Frank-2
Administrator
You need to add weka.jar to your Java CLASSPATH.

As you are in the Weka-3-8 folder, which contains weka.jar, you could use

java -cp weka.jar weka.Run …

to achieve this.

Cheers,
Eibe

> On 13/02/2019, at 1:05 AM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
>
> Hello Eibe,
> I tried to apply your proposed solution for exporting the weka tree output either to .dot or to .png file but unfortunately didn't work in windows.
> I attach the directory which is located the WEKA.
> <pastedImage.png>
> and the output of the command line of windows 10
> <pastedImage.png>
>
> I need the outputs in high-quality images for paper submission to a Journal with the appropriate reference to your software.
>
> Thank you very much for your help.
>
> Kind regards
>
> George
> From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
> Sent: Wednesday, February 6, 2019 1:36:26 AM
> To: Weka machine learning workbench list.
> Subject: Re: [Wekalist] Export/save J48 tree
>  
> It would be useful if you could post the error messages you get from using
>
>  graphviz-treevisualize-weka-package
>
> I’m currently having trouble using GraphViz on my Mac. Are you using a Mac by any chance?
>
> For high-quality output, the dot language is indeed a good option. If the package doesn’t work for you, you will have to do things manually (and you still need to get GraphViz to work).
>
> Unfortunately, there is no option in the GUI to output the tree in .dot format. This can only be done with the WEKA command-line interface at the moment.
>
> Here is what you can do:
>
> a) Right-click on the entry in the “Result list” and choose “Save model”.
>
> b) Use something like “my_j48_tree” as the filename (“.model” will be appended). Save the model in your home folder.
>
> c) Enter the following command-line to generate dot output in a console:
>
>   java weka.Run .J48 -l my_j48_tree.model -g -T <complete file name of your dataset > my_j48_tree.dot
>
> This will save the description of the tree in the dot language in the file my_j48_tree.dot. (The -T option with the file name has no effect but is currently necessary, unfortunately.)
>
> In theory, you can then process that file with the dot command from GraphViz. On the web, there is http://www.webgraphviz.com/
>
> Cheers,
> Eibe
>
> PS:
>
> Another really nice option is to run J48 in R, using the RWeka package in R. The partykit package for R can produce fantastic tree visualisations, e.g.:
>
>   https://stackoverflow.com/questions/33458754/understanding-partykit-graph-out-of-j48-in-r
>
>
> > On 5/02/2019, at 7:13 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
> >
> > Hello,
> > I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.
> > I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.
> > Is there any other way to export/save the weka trees?
> >
> > Thank you very much!
> >
> > George Feretzakis
> > _______________________________________________
> > Wekalist mailing list
> > Send posts to: [hidden email]
> > To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> > List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Φερετζάκης Γεώργιος

Eibe,

Thank you for your support but this solution doesn't work.

Is there anywhere a detailed tutorial about this procedure.

I have some J48 big decision trees and I cannot export them.


Thank you


George


From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
Sent: Tuesday, February 12, 2019 11:16:04 PM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
You need to add weka.jar to your Java CLASSPATH.

As you are in the Weka-3-8 folder, which contains weka.jar, you could use

java -cp weka.jar weka.Run …

to achieve this.

Cheers,
Eibe

> On 13/02/2019, at 1:05 AM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
>
> Hello Eibe,
> I tried to apply your proposed solution for exporting the weka tree output either to .dot or to .png file but unfortunately didn't work in windows.
> I attach the directory which is located the WEKA.
> <pastedImage.png>
> and the output of the command line of windows 10
> <pastedImage.png>
>
> I need the outputs in high-quality images for paper submission to a Journal with the appropriate reference to your software.
>
> Thank you very much for your help.
>
> Kind regards
>
> George
> From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
> Sent: Wednesday, February 6, 2019 1:36:26 AM
> To: Weka machine learning workbench list.
> Subject: Re: [Wekalist] Export/save J48 tree

> It would be useful if you could post the error messages you get from using
>
>  graphviz-treevisualize-weka-package
>
> I’m currently having trouble using GraphViz on my Mac. Are you using a Mac by any chance?
>
> For high-quality output, the dot language is indeed a good option. If the package doesn’t work for you, you will have to do things manually (and you still need to get GraphViz to work).
>
> Unfortunately, there is no option in the GUI to output the tree in .dot format. This can only be done with the WEKA command-line interface at the moment.
>
> Here is what you can do:
>
> a) Right-click on the entry in the “Result list” and choose “Save model”.
>
> b) Use something like “my_j48_tree” as the filename (“.model” will be appended). Save the model in your home folder.
>
> c) Enter the following command-line to generate dot output in a console:
>
>   java weka.Run .J48 -l my_j48_tree.model -g -T <complete file name of your dataset > my_j48_tree.dot
>
> This will save the description of the tree in the dot language in the file my_j48_tree.dot. (The -T option with the file name has no effect but is currently necessary, unfortunately.)
>
> In theory, you can then process that file with the dot command from GraphViz. On the web, there is http://www.webgraphviz.com/
>
> Cheers,
> Eibe
>
> PS:
>
> Another really nice option is to run J48 in R, using the RWeka package in R. The partykit package for R can produce fantastic tree visualisations, e.g.:
>
>   https://stackoverflow.com/questions/33458754/understanding-partykit-graph-out-of-j48-in-r
>
>
> > On 5/02/2019, at 7:13 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
> >
> > Hello,
> > I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.
> > I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.
> > Is there any other way to export/save the weka trees?
> >
> > Thank you very much!
> >
> > George Feretzakis
> > _______________________________________________
> > Wekalist mailing list
> > Send posts to: [hidden email]
> > To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> > List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Eibe Frank-3
If you send me the J48 model files, I can have a quick go and try to produce PDFs for you.

Cheers,
Eibe

On Wed, 13 Feb 2019 at 11:37 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:

Eibe,

Thank you for your support but this solution doesn't work.

Is there anywhere a detailed tutorial about this procedure.

I have some J48 big decision trees and I cannot export them.


Thank you


George


From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
Sent: Tuesday, February 12, 2019 11:16:04 PM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
You need to add weka.jar to your Java CLASSPATH.

As you are in the Weka-3-8 folder, which contains weka.jar, you could use

java -cp weka.jar weka.Run …

to achieve this.

Cheers,
Eibe

> On 13/02/2019, at 1:05 AM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
>
> Hello Eibe,
> I tried to apply your proposed solution for exporting the weka tree output either to .dot or to .png file but unfortunately didn't work in windows.
> I attach the directory which is located the WEKA.
> <pastedImage.png>
> and the output of the command line of windows 10
> <pastedImage.png>
>
> I need the outputs in high-quality images for paper submission to a Journal with the appropriate reference to your software.
>
> Thank you very much for your help.
>
> Kind regards
>
> George
> From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
> Sent: Wednesday, February 6, 2019 1:36:26 AM
> To: Weka machine learning workbench list.
> Subject: Re: [Wekalist] Export/save J48 tree

> It would be useful if you could post the error messages you get from using
>
>  graphviz-treevisualize-weka-package
>
> I’m currently having trouble using GraphViz on my Mac. Are you using a Mac by any chance?
>
> For high-quality output, the dot language is indeed a good option. If the package doesn’t work for you, you will have to do things manually (and you still need to get GraphViz to work).
>
> Unfortunately, there is no option in the GUI to output the tree in .dot format. This can only be done with the WEKA command-line interface at the moment.
>
> Here is what you can do:
>
> a) Right-click on the entry in the “Result list” and choose “Save model”.
>
> b) Use something like “my_j48_tree” as the filename (“.model” will be appended). Save the model in your home folder.
>
> c) Enter the following command-line to generate dot output in a console:
>
>   java weka.Run .J48 -l my_j48_tree.model -g -T <complete file name of your dataset > my_j48_tree.dot
>
> This will save the description of the tree in the dot language in the file my_j48_tree.dot. (The -T option with the file name has no effect but is currently necessary, unfortunately.)
>
> In theory, you can then process that file with the dot command from GraphViz. On the web, there is http://www.webgraphviz.com/
>
> Cheers,
> Eibe
>
> PS:
>
> Another really nice option is to run J48 in R, using the RWeka package in R. The partykit package for R can produce fantastic tree visualisations, e.g.:
>
>   https://stackoverflow.com/questions/33458754/understanding-partykit-graph-out-of-j48-in-r
>
>
> > On 5/02/2019, at 7:13 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
> >
> > Hello,
> > I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.
> > I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.
> > Is there any other way to export/save the weka trees?
> >
> > Thank you very much!
> >
> > George Feretzakis
> > _______________________________________________
> > Wekalist mailing list
> > Send posts to: [hidden email]
> > To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> > List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Φερετζάκης Γεώργιος

Eibe,

Is it possible to produce for me and the .dot files, otherwise the pdf's or png format are ok.


Thank you very much!

I appreciate your help!


George


From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
Sent: Wednesday, February 13, 2019 12:53:18 PM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
If you send me the J48 model files, I can have a quick go and try to produce PDFs for you.

Cheers,
Eibe

On Wed, 13 Feb 2019 at 11:37 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:

Eibe,

Thank you for your support but this solution doesn't work.

Is there anywhere a detailed tutorial about this procedure.

I have some J48 big decision trees and I cannot export them.


Thank you


George


From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
Sent: Tuesday, February 12, 2019 11:16:04 PM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
You need to add weka.jar to your Java CLASSPATH.

As you are in the Weka-3-8 folder, which contains weka.jar, you could use

java -cp weka.jar weka.Run …

to achieve this.

Cheers,
Eibe

> On 13/02/2019, at 1:05 AM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
>
> Hello Eibe,
> I tried to apply your proposed solution for exporting the weka tree output either to .dot or to .png file but unfortunately didn't work in windows.
> I attach the directory which is located the WEKA.
> <pastedImage.png>
> and the output of the command line of windows 10
> <pastedImage.png>
>
> I need the outputs in high-quality images for paper submission to a Journal with the appropriate reference to your software.
>
> Thank you very much for your help.
>
> Kind regards
>
> George
> From: [hidden email] <[hidden email]> on behalf of Eibe Frank <[hidden email]>
> Sent: Wednesday, February 6, 2019 1:36:26 AM
> To: Weka machine learning workbench list.
> Subject: Re: [Wekalist] Export/save J48 tree

> It would be useful if you could post the error messages you get from using
>
>  graphviz-treevisualize-weka-package
>
> I’m currently having trouble using GraphViz on my Mac. Are you using a Mac by any chance?
>
> For high-quality output, the dot language is indeed a good option. If the package doesn’t work for you, you will have to do things manually (and you still need to get GraphViz to work).
>
> Unfortunately, there is no option in the GUI to output the tree in .dot format. This can only be done with the WEKA command-line interface at the moment.
>
> Here is what you can do:
>
> a) Right-click on the entry in the “Result list” and choose “Save model”.
>
> b) Use something like “my_j48_tree” as the filename (“.model” will be appended). Save the model in your home folder.
>
> c) Enter the following command-line to generate dot output in a console:
>
>   java weka.Run .J48 -l my_j48_tree.model -g -T <complete file name of your dataset > my_j48_tree.dot
>
> This will save the description of the tree in the dot language in the file my_j48_tree.dot. (The -T option with the file name has no effect but is currently necessary, unfortunately.)
>
> In theory, you can then process that file with the dot command from GraphViz. On the web, there is http://www.webgraphviz.com/
>
> Cheers,
> Eibe
>
> PS:
>
> Another really nice option is to run J48 in R, using the RWeka package in R. The partykit package for R can produce fantastic tree visualisations, e.g.:
>
>   https://stackoverflow.com/questions/33458754/understanding-partykit-graph-out-of-j48-in-r
>
>
> > On 5/02/2019, at 7:13 PM, Φερετζάκης Γεώργιος <[hidden email]> wrote:
> >
> > Hello,
> > I'd like to export/save the tree of J48 either as png file with High quality for publication purposes. I'd also like to save the ouput of WEKA tree (for example j48) and one can open it without having the WEKA Software.
> > I tried to use graphviz-treevisualize-weka-package but unfortunately I got constant errors from the weka console. Althouth there is the option of plugins with right-click in the tree I cannot reproduce the graph in .dot format.
> > Is there any other way to export/save the weka trees?
> >
> > Thank you very much!
> >
> > George Feretzakis
> > _______________________________________________
> > Wekalist mailing list
> > Send posts to: [hidden email]
> > To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> > List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

1.model (23K) Download Attachment
2.model (44K) Download Attachment
3.model (45K) Download Attachment
4.model (24K) Download Attachment
5.model (23K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Peter Reutemann
> Is it possible to produce for me and the .dot files, otherwise the pdf's or png format are ok.

You might want to use my unofficial "serialized-model-viewer" package:
  https://github.com/fracpete/serialized-model-viewer-weka-package

I just released a new version that now displays an extra tab with the
graph data of the model, in case it implements weka.core.Drawable,
like J48 or BayesNet.

Just download the latest release ZIP file and then install it through
the Package Manager's "Unofficiall file/URL" button.

BTW Instead of running the commands that Eibe mentioned to you from a
terminal, you can also use Weka's SimpleCLI for that. Then you don't
have to add the weka.jar to your classpath.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Φερετζάκης Γεώργιος

Hello Peter,

I'll try your package and I'll give you feedback asap.

Thank you very much!


Cheers, George



From: [hidden email] <[hidden email]> on behalf of Peter Reutemann <[hidden email]>
Sent: Wednesday, February 13, 2019 11:01:20 PM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
> Is it possible to produce for me and the .dot files, otherwise the pdf's or png format are ok.

You might want to use my unofficial "serialized-model-viewer" package:
  https://github.com/fracpete/serialized-model-viewer-weka-package

I just released a new version that now displays an extra tab with the
graph data of the model, in case it implements weka.core.Drawable,
like J48 or BayesNet.

Just download the latest release ZIP file and then install it through
the Package Manager's "Unofficiall file/URL" button.

BTW Instead of running the commands that Eibe mentioned to you from a
terminal, you can also use Weka's SimpleCLI for that. Then you don't
have to add the weka.jar to your classpath.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Φερετζάκης Γεώργιος
In reply to this post by Peter Reutemann

Peter,

this package is incredible!

Thank you so much!



Best,

George


From: [hidden email] <[hidden email]> on behalf of Peter Reutemann <[hidden email]>
Sent: Wednesday, February 13, 2019 11:01:20 PM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
> Is it possible to produce for me and the .dot files, otherwise the pdf's or png format are ok.

You might want to use my unofficial "serialized-model-viewer" package:
  https://github.com/fracpete/serialized-model-viewer-weka-package

I just released a new version that now displays an extra tab with the
graph data of the model, in case it implements weka.core.Drawable,
like J48 or BayesNet.

Just download the latest release ZIP file and then install it through
the Package Manager's "Unofficiall file/URL" button.

BTW Instead of running the commands that Eibe mentioned to you from a
terminal, you can also use Weka's SimpleCLI for that. Then you don't
have to add the weka.jar to your classpath.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Peter Reutemann
> this package is incredible!

You're welcome.

If you want to widen your horizon... Attached is an ADAMS workflow
(https://adams.cms.waikato.ac.nz/) that allows you to select an
arbitrary number of .model/.ser files from a directory, loads them and
displays their graphs (dot or XML BIF).

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

models.flow (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Export/save J48 tree

Φερετζάκης Γεώργιος

Thanks again!

Your help is invaluable Peter!


Cheers, George


From: [hidden email] <[hidden email]> on behalf of Peter Reutemann <[hidden email]>
Sent: Wednesday, February 13, 2019 11:43:00 PM
To: Weka machine learning workbench list.
Subject: Re: [Wekalist] Export/save J48 tree
 
> this package is incredible!

You're welcome.

If you want to widen your horizon... Attached is an ADAMS workflow
(https://adams.cms.waikato.ac.nz/) that allows you to select an
arbitrary number of .model/.ser files from a directory, loads them and
displays their graphs (dot or XML BIF).

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html