-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProccessWindowResults.m
36 lines (25 loc) · 990 Bytes
/
ProccessWindowResults.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
33
34
35
36
function [ output_args ] = ProccessWindowResults( ConsensusModel, window,D , RecordClusters, v, Clusters, anomalyLabel)
%PROCCESSWINDOWRESULTS Summary of this function goes here
% Detailed explanation goes here
wl = length(window);
ID = 1:length(window);
result = [ID' window(:,1:D) window(:,D+3) zeros(1,wl)' ConsensusModel];
[ FP, FN, TP, TN] = ProcessResults(result, D, anomalyLabel);
anms = [];
for k = 1:size(window,1)
if(result(k,D + 2) < 1)
anms = [anms; k window(k,:)];
end
end
accuracy = (TP + TN) ./ size(window,1);
specificity = TN ./(size(window,1) - size(anms,1));
sensitivity = TP ./ size(anms,1);
% numOfWindows
% numOfModels
% accuracy
% specificity
% sensitivity
% FP
% FN
PlotEnsembleResults(result, D, wl, 'window', TP, TN, FP, FN, accuracy, specificity, sensitivity, 0, RecordClusters, v, Clusters, anomalyLabel);
end