-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_example_modular.m
68 lines (59 loc) · 2.16 KB
/
main_example_modular.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% @author Tiffany Jann
% @date August 17, 2017
% @adapted from main_example.m
% @contact [email protected]
%%% THIS SCRIPT IS ADAPTED FROM MAIN_EVAL_ALL TO UTILIZE MODULAR FUNCTIONS
clc,clear
format short
%%%%% LOAD DATA %%%%%
% for input file, either use user's own file, or load default example file;
try
disp('load your own *.mat file: ')
[file,path] = uigetfile('*.mat');
if file
filename = strcat(path, file);
load(filename)
fprintf('data file successfully loaded from ')
disp(strcat(path, file))
else
load('example.mat');
disp('no file selected. default file loaded.')
end
catch % if user's selected file causes an error
% load an example data file; keep all the files in the same folder;
load('example.mat');
disp('an error occured. default file loaded.')
end
clear file filename path;
% prompt for data dimensions
% default values correspond to default example data
[num_time_series, num_nodes] = input_dim_dialog();
%%%%% SELECT DISCRETIZATION %%%%%
% asks user to select from available discretization methods in loaded data
vn = GetDiscretizationMethods(who());
DiscMethodChoice = choosedialog( vn );
disp('Discretizaition of Choice: ');
try fprintf(['\t',DiscMethodChoice, '\n']);
test_data = eval(DiscMethodChoice);
catch
% if user closes the window or cancels before using the dropdown menu
test_data = eval(vn{1});
disp(vn{1}); % TDT will be printed, without the tab, distinguishing from deliberate selection
end
clear vn DiscMethodChoice;
test_data = normalize_t(test_data);
% %%%%% DATA NORMALIZATION %%%%%
% nouveau = ( test_data - ones(size(test_data)) * min(min(test_data)) ) / (max(max(test_data)) - min(min(test_data)));
% clear test_data;
% test_data = nouveau;
% clear nouveau;
%%%%% COMPUTATIONS %%%%%
val = qualification_t(original, test_data, num_time_series, num_nodes);
if strcmp(val, "failed qualification") == 1
disp("stop here! qualification failed. choose another discretization method!");
else
disp("qualification passed! move onto evaluation");
disp("mean area between the curve: ");
disp(val);
end
clear test_data zygote num_time_series num_nodes;