MCSVM_1.0 - Multiclass SVM Copyright (C) Koby Crammer and Yoram Singer Code was developed 2001-2004 at the Hebrew University, Jerusalem, Israel Written by Koby Crammer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1. Terms of use %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MCSVM_1.0 is freeware and is distributed under the conditions of the GNU General Public License version 2, which allows free distribution and modification but prevents the use of this code in commercial packages. You are welcome to use the code for your research under the terms of the license. However, please acknowledge its use with the following citation: Koby Crammer "MCSVM_1.0: C Code for Multiclass SVM", http://www.cis.upenn.edu/~crammer, 2003. If you use the code and find it useful, I would appreciate a note from you: crammer@cis.upenn.edu 2. The Code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% run : gunzip MCSVM_1.0.tar.gz tar -xvf MCSVM_1.0.tar make There are five executables, arranged in three groups. 1) mcsvm-train, mcol-train, mcsvm-ol-train 2) mcol-test 3) mcls2txt The first group contains the learning algorithms. All of them learn a multi-class classifier which employs one vector "w" per class. 1) a. mcsvm-train : an implementation the algorithm given in [1]. b. mcol-train : an online algorithm (named MIRA) which uses small QP's and can be find in section 5 of [2]. c. mcsvm-ol-train : uses MIRA as a filter over the training set. It first runs MIRA and marks all the examples which MIRA used as support patterns. This subset of support pattern are used as a training set for the multiclass SVM batch algorithm. When the training set is large (as in MNIST) this decreases the run time. For each executable run " -h" to get all the option. A standard run on a prefix of USPS looks like (see the sub-directory example), mcsvm-train -m 500 -l 256 -k 10 -b 0.1 -t 2 -d 9 example/usps.train.500 example/usps.cls mcsvm-ol-train -m 500 -l 256 -k 10 -b 0.1 -t 2 -d 9 example/usps.train.500 example/usps.cls mcol-train -m 500 -l 256 -k 10 -b 0.1 -t 2 -d 9 example/usps.train.500 example/usps.cls 2) mcol-test : evaluates a classifier (obtained by one of the above programs) on a test set. It should invoked as follows : mcol-test example/usps.train.500 example/usps.cls example/usps.test.500 example/usps.rpt 500 3) mcls2txt : All the training algorithms save their output in a binary format. To convert a classifier from binary to ASCII text run mcls2txt. 3. The Data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Data set should be prepared in a single file (training set and a test set should be saved in different files). Each instance is placed in a line in the following format :