-
Notifications
You must be signed in to change notification settings - Fork 42
/
loadclass.m
executable file
·32 lines (29 loc) · 1.43 KB
/
loadclass.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% LOADCLASS - Loads the SVM from the specified file into memory.
%
% Syntax: loadclass(fname)
%
% Version 3.22e -- Comments to [email protected]
%
function loadclass(fname)
% define global variables
global a; % alpha coefficients
global b; % bias
global C; % regularization parameters
global deps; % jitter factor in kernel matrix
global g; % partial derivatives of cost function w.r.t. alpha coefficients
global ind; % cell array containing indices of margin, error, reserve and unlearned vectors
global max_reserve_vectors; % maximum number of reserve vectors stored
global Q; % extended kernel matrix for all vectors
global Rs; % inverse of extended kernel matrix for margin vectors
global scale; % kernel scale
global type; % kernel type
global uind; % user-defined example indices
global X; % matrix of margin, error, reserve and unlearned vectors stored columnwise
global y; % column vector of class labels (-1/+1) for margin, error, reserve and unlearned vectors
% load SVM state
flag = 0;
cmd = sprintf('load %s a b C deps g ind max_reserve_vectors Q Rs scale type uind X y;',fname);
eval(cmd,'flag = 1;');
if (flag)
disp('LOADCLASS: Unable to load the SVM!');
end;