-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoSearchlightLeaveOneOutCrossValidation_SVM.m
executable file
·31 lines (30 loc) · 1.54 KB
/
doSearchlightLeaveOneOutCrossValidation_SVM.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
% Does a searchlight classification using a SVM and Leave One Out Cross Validation.
%
% Author: Maurice Hollmann
% Date : 09/10
%
% Description:
% This high-level function implements a simple prediction using a Support Vector Machine (SVM).
%
%
% Parameters:
% dataset - the datset holding the test set to do prediction for
% svmModel - the model learned via train_SVM
%
% Returns:
% resultStruct - The struct holding the classification results:
% resultStruct.nmbTests (the number of samples tested for this result)
% resultStruct.accuracy (percentual value of correct predictions (correct * 100 / nmbSamples))
% resultStruct.sensitivity (TP/TP+FN = Proportion of true positives to all positives)
% resultStruct.specificity (TN/TN+FP = Proportion of true negatives to all negatives)
% resultStruct.TP (True positives = all correct predicted in class 1)
% resultStruct.TN (True negatives = all correct predicted in class 2)
% resultStruct.FP (False positives = all incorrect predicted in class 1)
% resultStruct.FN (False negatives = all incorrect predicted in class 2)
%
% probEstimates - Probability estimates if model was learned with Option 'probEstimates' = 1, otherwise empty matrix
%
% Comments:
%
function [dataset, resultStruct, avgWeights] = doSearchlightLeaveOneOutCrossValidation_SVM(dataset, dataSplitter, kernelMode, costParam, paramStruct)
end