A Practice on LIBSVM Example in Debian Etch Using Java

This exercise comes from “A Practical Guide to Support Vector Classification” paper by Chih-WEi Hsu, Chih-Chung Chang and Chih-Jen Lin. It can be downloaded from http://www.csie.ntu.edu.tw/~cjlin/libsvm/index.html.

The goal for writing this page is to record step-by-step instructions of an example in the paper above using Java version in Debian Etch. So, this record will be used as a reference for my future review on LIBSVM.

1) Download libsvm-2.84.tar.gz from the web address above.

2) Unzip the file

3) Change directory to the unzipped directory, libsvm-2.84

> cd libsvm-2.84

> cd java

4) Compile all java files in the libsvm-2.84/java directory

5) Download a dataset “Astroparticle Physics” from http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/. On the page, click on “svmguide1″. Then, download “svmguide1″ and “svmguide1.t”. “svmguide1″ is a training dataset and “svmguide1.t” is a testing dataset.

6) Train the dataset

>java svm-train svmguide1

7) Test

>java svm-predict svmguide1.t svmguide1.model svmguide1.predict

The output from step 7, is Accuracy = 66.925%, which is the same as described in the paper.

About these ads
This entry was posted in Java, text mining. Bookmark the permalink.

3 Responses to A Practice on LIBSVM Example in Debian Etch Using Java

  1. Dollag says:

    i am gonna show this to my friend, bro

  2. Pimp says:

    Somehow i missed the point. Probably lost in translation :) Anyway … nice blog to visit.

    cheers, Pimp.

  3. Ruwan Egodawatte says:

    Can you provide an example of doing the exact same thing in my own program (A usage example of java classes in LibSVM)?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s