Skip to content
Kehang Han edited this page Oct 23, 2016 · 43 revisions

Table of Contents

Download

Download the source from the Git repository http://github.com/CBCL/GURLS

Installation

Hello World

Hello World in GURLS

Have a look, and run gurls_helloworld.m in the 'demo' subdirectory. Below we describe the demo in details.

We first have to load the training data

 >> load('data/quickanddirty_traindata;')

and train the classifier

 >> [opt] = gurls_train(Xtr,ytr);

now we load the test data

 >> load('data/quickanddirty_testdata');

then we predict the labels for the test set and asses prediction accuracy

 >> [yhat,acc] = gurls_test(opt,Xte,yte);

Hello World in GURLS++

Have a look, and run helloworld.cpp in the 'demo' subdirectory. Below we describe the salient parts of demo in details. First we have to load the training data

 Xtr = readFile<T>("../data/Xtr.txt");
 ytr = readFile<T>("../data/ytr_onecolumn.txt");

and the test data

 Xte = readFile<T>("../data/Xte.txt");
 yte = readFile<T>("../data/yte_onecolumn.txt");

then we train the classifer

 GurlsOptionsList* opt = gurls_train(*Xtr, *ytr);

finally we predict the labels for the test set and asses prediction accuracy

 gurls_test(*Xte, *yte, *opt);