GenSVM
Functions
test_gensvm_predict.c File Reference

Unit tests for gensvm_predict.c functions. More...

#include "minunit.h"
#include "gensvm_predict.h"
Include dependency graph for test_gensvm_predict.c:

Go to the source code of this file.

Functions

char * test_gensvm_predict_labels_dense ()
 
char * test_gensvm_predict_labels_sparse ()
 
char * test_gensvm_prediction_perf ()
 
char * all_tests ()
 
 RUN_TESTS (all_tests)
 

Detailed Description

Unit tests for gensvm_predict.c functions.

Author
G.J.J. van den Burg
Date
2016-09-01

This file is part of GenSVM.

GenSVM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GenSVM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GenSVM. If not, see http://www.gnu.org/licenses/.

Definition in file test_gensvm_predict.c.

Function Documentation

◆ all_tests()

char* all_tests ( )

Definition at line 274 of file test_gensvm_predict.c.

Here is the call graph for this function:

◆ RUN_TESTS()

RUN_TESTS ( all_tests  )

◆ test_gensvm_predict_labels_dense()

char* test_gensvm_predict_labels_dense ( )

This testcase is designed as follows: 12 evenly spaced points are plotted on the unit circle in the simplex space. These points are the ones for which we want to predict the class. To get these points, we need a Z and a V which map to these points. To get this, Z was equal to [1 Q] and V was equal to [0; R] where Q and R are from the reduced QR decomposition of the 12x2 matrix S which contains the points in simplex space. Here's the Matlab/Octave code to generate this data:

n = 12;
K = 3;
S = [cos(1/12*pi+1/6*pi*[0:(n-1)])', sin(1/12*pi+1/6*pi*[0:(n-1)])'];
[Q, R] = qr(S, '0');
Z = [ones(n, 1), Q];
V = [zeros(1, K-1); R];

Definition at line 47 of file test_gensvm_predict.c.

Here is the call graph for this function:

◆ test_gensvm_predict_labels_sparse()

char* test_gensvm_predict_labels_sparse ( )

Definition at line 139 of file test_gensvm_predict.c.

Here is the call graph for this function:

◆ test_gensvm_prediction_perf()

char* test_gensvm_prediction_perf ( )

Definition at line 237 of file test_gensvm_predict.c.

Here is the call graph for this function: