Overview
Weka
is easy to use when we do feature selection and classification. Using Weka
's friendly graphic user interface, we can try and validate multiple feature selection methods and classifiers that have already been implemented into Weka. This article tries to give a quick start guide about this wonderful tool.
1. Download Weka
1.1 About different versions
You can download Weka
with different versions from Weka's Download page. There are Stable book 3rd ed. version(3.6.12)
and Developer version(3.7.12+)
available.
Stable book 3rd ed. version
is a stable version for use. If this version can meet all your demands or you don't know what functions you need, use this one.
Compared to the former versions of Weka
, Developer version(3.7.12+)
adopts a new architecture, which provides a package manager in the tool
menu. Unlike that Stable book 3rd ed. version(3.6.12)
provides all the methods and classifier it can, Developer version(3.7.12+)
only provides a series of basic methods and classifiers in default, however, with a new-developed package manager. If you want some classifier, open the package manager and download this classifier, then you can use it in Weka
.
Taking feature selection as an instance, we want to use mRMR method to select features. Fortunately, mRMR is involved in weka at version 3.5.15. We don't need to update a new version since we only need this function. Open the package manager in the existing 3.7.12 version, we can easily download and use it.
1.2 For users in different platforms
Weka
provides a series of versions that can run on Windows, Mac and other platforms(a zip file). For Windows and Mac users, you can directly download the corresponding version, install it and use it. However, I recommend you to download a zip version to use. When you wanna use SVM classifier in Weka 3.6.12
, you will need the zip version. (How to involve libSVM in weka 3.6.12 will be depicted in another article)
2. Use Weka
If you download the non-zip version, I guess you are already using Weka
. So we just talk about how to use the zip version.
2.1 Run Weka
Enter the weka folder, and use the following command to start it:
java -Xmx1000M -jar weka.jar
Notice the parameter -Xmx1000M. This means Weka
can use a maximum of 1000M memory to use. When you wanna training big data set, set a bigger value will prevent the breakdown of Weka
(I use 4000M memory).
2.1 Run Weka anywhere
We have already run Weka
. There is still a problem: Every time we wanna use Weka
, we have to enter the Weka
folder and run the start command.
By setting the environmental viable, we can tackle this problem. The setting in my computer is as follows:
CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:/Users/wangjiawei/weka/weka-3-6-12/weka.jar
/Users/wangjiawei/weka/weka-3-6/
is the folder of Weka
. After adding the folder address into CLASHPATH, we can use the start command at any place.