-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.m
More file actions
22 lines (19 loc) · 745 Bytes
/
Copy pathmain.m
File metadata and controls
22 lines (19 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function main(string)
% Generate a dataset
rng(0)
[X, count, truth] = string2data(string, 100, 15);
n = size(X, 1);
disp('Visualize the dataset. Press any key to continue...')
pause
% Run unpenalized LTSS and SVM for comparison
disp('Running unpenalized LTSS and SVM...')
spatial_label = svm(X, count, 5, 2000);
fprintf('Spatial Accuracy:%f\n', sum(spatial_label==truth) ./ n)
disp('Press any key to continue...')
pause
% Run Support Vector Subset Scan
disp('Running Support Vector Subset Scan')
[label, spatial_label] = svss(X, count, 5, 2000, 1000);
fprintf('Accuracy:%f\n', sum(label==truth) ./ n)
fprintf('Spatial Accuracy:%f\n', sum(spatial_label==truth) ./ n)
end