Introduction

HSVM is a Matlab package that has been tested on Linux machines running Matlab 6.5. It has three core packages that handle: 1. Max-cut hierarchical class decomposition, 2. SVM training and testing and 3. the main structure that controls input, output and communication between max-cut and SVM.

The source code can be downloaded here: HSVM.zip. After you unzip this file, you will get a folder named "HSVM" that includes the three core packages that were presented.

Running HSVM

Steps to run HSVM:
  • Of course! open your matlab terminal and have your CSR format training and testing data ready.
  • Type "SetPath" to link all the packages.
  • Type "Init_run" and follow the flow. Here is an example screen log: example.txt.
  • Log file that records results will be stored in /Results folder. The Botswana 50% training results uses KL distance is presented here: Rate4KL.txt

    CSR data format

    Data structure of CSR format
  • Matlab(5.0 or higher) .mat file
  • Separated training and testing set
  • Example: KSC_TRAIN_expt1_Rate4.mat can be read as
    • KSC-> Site KSC
    • TRAIN-> Training data set
    • Expt1-> Experiment #1
    • Rate4-> Sampling rate #4 (in this case, its 50% of the original sample set)
  • Loading CSR format data into matlab
    • Type "load KSC_TRAIN_expt1_Rate1"
    • When you type "who" the terminal shows a cell matrix called [TrainingData] because the file you loaded is KSC_TRAIN_*. If you load KSC_TEST_expt1, and type "who", you will get the name of a cell matrix, [TestData], showing on the terminal.
    • Both TrainingData and TestData are cell matrices (more details please see www.mathworks.com). When you type "size(TrainingData,2)", the terminal shows the total number of classes. Data of each class is stored in each cell matrix. For example, TrainingData{1} is used by a classifier to construct the classification model for class 1. TrainingData{2} has samples of class 2 and so forth and so on.
    • [NumOfSample,NumOfDim] = size(TrainingData{1});

    Create a CSR format data

    Download this code: CSRinput.m
  • Run "CSRinput(Data, ClassLabel)", while Data is a (NbSample*Dim) matrix and ClassLabel is a (NbSample*1) column matrix.
  • For each class, the original data will be sampled according to this figure.
  • Sampling

    posted by Yangchi Chen