GenSVM
|
Unit tests for gensvm_predict.c functions. More...
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) | |
Unit tests for gensvm_predict.c functions.
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.
char* all_tests | ( | ) |
RUN_TESTS | ( | all_tests | ) |
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.
char* test_gensvm_predict_labels_sparse | ( | ) |
char* test_gensvm_prediction_perf | ( | ) |