-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJournal_Exp_4_Fun_nFiles_keogh.m
44 lines (33 loc) · 1.37 KB
/
Journal_Exp_4_Fun_nFiles_keogh.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
% This experiment is for varying kNN
function Journal_Exp_4_Fun_nFiles_keogh(datasetName, textFileSavingName)
subSeqLen = 256; % The length of the sub-sequence
whichDimToConsider = 1;
kNN_Uwant = 10; % How many kNN do you want, just tell me
% Loading the sheep data
load(datasetName);
keepAllData = seeMe1(1:1000,:); % take only 16000 time series ;
clear seeMe1;
textFileNam = textFileSavingName;
if (exist(textFileNam, 'file') == 0)
disp('File does not exist, creating file.')
fid = fopen( textFileNam, 'w' );
else % if the file exist
disp('File exists.');
fid = fopen(textFileNam, 'wt' ); % create a new file each time
end
keepTargetData = keepAllData;
clear keepAllData;
takenRws = 100;
while (takenRws < 1001)
% fprintf('The number of rows to be considered %d and the number of rows present in the matrix %d', takenRws, size(keepTargetData,1));
if(takenRws > size(keepTargetData,1))
takenRws = size(keepTargetData,1);
end
keepTargetDataCut = keepTargetData(1:takenRws,:);
wholetime = Match_Subseq_N_Query_SelfJoin_MultiCoreShort_keogh(keepTargetDataCut, subSeqLen, kNN_Uwant); % working for the 2nd column here
fprintf(fid, 'The Number of rows is %d and time needed is : %d \n',takenRws, wholetime);
takenRws = takenRws + 200;
clear keepTargetDataCut
end
fclose(fid);
end