Configuring the CLASSPATH environment variable on Windows 8.1 to use WEKA tools from the command line with Java.
Mark Hall, Eibe Frank, Geoffrey Holmes, Bernhard Pfahringer, Peter Reutemann, Ian H. Witten (2009); The WEKA Data Mining Software: An Update; SIGKDD Explorations, Volume 11, Issue 1.
2. Three simple phases
1. Locate WEKA installation directory
2. Create/edit the CLASSPATH environment
variable
3. Execute the weka.gui.GUIChooser main class
3. Locate WEKA installation directory
In this case the directory is
“C:devWeka-3-6”.
The file name required is:
“weka.jar”.
4. Assumptions for phase 2
The following pictures are taken on Windows 8.1 with Italian interface, so
consider that:
1) @1st step use the search tool by moving the pointer on the right side of
the screen and type “environment variables” and open the editor for
them
2) @2nd step there are two possibilities for the CLASSPATH env. var.:
a) it does not exist and then it must be created; click on “New”
b) it already exists and then it must be edited; click on “Edit” and add the WEKA path
6. Create/edit the CLASSPATH environment variable
The value must include “weka.jar”
NOTE: the pictures shows case a, where no other paths are in the CLASSPATH
because it has been created on purpose.
3rd step
7. Finale: execute weka.jar main class
The weka.jar archive has the following main class:
weka.gui.GUIChooser
The following command will launch the WEKA GUI:
java weka.gui.GUIChooser
8. Launching WEKA tools
It is possible to call WEKA tools externally just specifying their package and
name, for example:
java weka.filters.unsupervised.attribute.PrincipalComponents
-i C:devWeka-3-6datairis.arff -o iris-PC.arff -c last