-
Notifications
You must be signed in to change notification settings - Fork 0
/
testWithAllFiles.m
46 lines (41 loc) · 1.28 KB
/
testWithAllFiles.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
37
38
39
40
41
42
43
44
45
46
function [p]= testWithAllFiles(model)
dir = 'dataset/Sprocessed/';
fileName ='S00';
%k = ['F','N','O','S','Z']
predictions = [];
for k = ['F','N','O','Z','S']
preds = [];
dir(9)= k;
fileName(1) = k;
sum = 0;
file = append(dir,fileName,string(1),'.csv'); % Specifying the filename
pred = predictWithSignleReading(file, model);
preds = [preds pred];
sum = sum+pred;
% Process TXT file from 002 to 009
for i = 2:9
fileNumber =i;
file = append(dir,fileName,string(fileNumber),'.csv');
pred = predictWithSignleReading(file, model);
preds = [preds pred];
sum = sum+pred;
end
% Process TXT file from 010 to 099
for j = 10:99
fileNumber =j;
file = append(dir,fileName(1:2),string(fileNumber),'.csv');
pred = predictWithSignleReading(file, model);
preds = [preds pred];
sum = sum+pred;
end
% Process TXT file No. 100
file = append(dir,fileName(1),string(100),'.csv'); % Specifying the filename
pred = predictWithSignleReading(file, model);
preds = [preds pred];
sum = sum+pred;
% Print the result
%fprintf("Seizure Activity on %c detected for %d files \n",k,sum)
predictions = [predictions preds];
end
p = predictions;
end