-
Notifications
You must be signed in to change notification settings - Fork 39
/
RunSPIRALRepLearning.m
36 lines (20 loc) · 1.31 KB
/
RunSPIRALRepLearning.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 RunSPIRALRepLearning(DataSetStartIndex, DataSetEndIndex)
% first 2 values are '.' and '..' - UCR Archive 2018 version has 128 datasets
dir_struct = dir('./UCR2018/');
Datasets = {dir_struct(3:130).name};
% Sort Datasets
[Datasets, DSOrder] = sort(Datasets);
addpath(genpath('SPIRAL/.'));
for i = 1:length(Datasets)
if (i>=DataSetStartIndex && i<=DataSetEndIndex)
display(['Dataset being processed: ', char(Datasets(i))]);
DS = LoadUCRdataset(char(Datasets(i)));
NumOfSamples = min(max( [4*length(DS.ClassNames), ceil(0.4*DS.DataInstancesCount),20] ),100);
tic;
ZRep = SPIRALRepLearning(DS, NumOfSamples);
RTResult = toc;
dlmwrite( strcat( 'SPIRALREPRESENTATIONS','/',char(Datasets(i)),'/','SPIRALREPRESENTATIONS', '.Zrep'), ZRep, 'delimiter', '\t');
dlmwrite( strcat( 'SPIRALREPRESENTATIONS-RT','/',char(Datasets(i)),'/','SPIRALREPRESENTATIONS', '.RT'), RTResult, 'delimiter', '\t');
end
end
end