-
Notifications
You must be signed in to change notification settings - Fork 9
/
cardio_runSVDs.m
86 lines (64 loc) · 1.6 KB
/
cardio_runSVDs.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
% ńîçäŕňü ďđčçíŕęč, îńíîâŕííűĺ íŕ SVD-đŕçëîćĺíčč (đĺřĺíčĺ çŕäŕ÷č CardioQVARK - Äü˙ęîíîâ Ŕëĺęńŕíäđ, ÂĚĘ ĚĂÓ)
% çŕăđóçčňü äŕííűĺ
cardio_loadtrain
%cardio_loadtrain_filtered
cardio_loadtest
%cardio_loadtest_filtered
Y = cardio_importfile('traininfo.txt');
y = Y(:,3);
% íóëĺâűĺ ěŕňđčöű äë˙ çŕďîëíĺíč˙
L = zeros([100 3]);
U1 = zeros([100 1000]);
U2 = zeros([100 1000]);
U3 = zeros([100 1000]);
V1 = zeros([100 300]);
for t=1:length(S)
if ismember(t, [8 41 96 100]) % číâĺđńč˙ ńčăíŕëîâ
x = -S{t};
else
x = +S{t};
end;
[l, u1, u2, u3, v1] = cardio_extractSVDs(x);
L(t,:) = l;
U1(t,:) = u1;
U2(t,:) = u2;
U3(t,:) = u3;
V1(t,:) = v1;
disp(t);
end;
L2 = zeros([100 3]);
U12 = zeros([100 1000]);
U22 = zeros([100 1000]);
U32 = zeros([100 1000]);
V12 = zeros([100 300]);
for t=1:length(S2)
x = +S2{t};
[l, u1, u2, u3, v1] = cardio_extractSVDs(x);
L2(t,:) = l;
U12(t,:) = u1;
U22(t,:) = u2;
U32(t,:) = u3;
V12(t,:) = v1;
disp(t);
end;
%-----------------
% ďđčçíŕęč
AU1 = abs(U1);
AU12 = abs(U12);
AU1 = AU1(:,[467 655]);
AU12 = AU12(:,[467 655]);
AU2 = abs(U2);
AU22 = abs(U22);
AU2 = AU2(:,[138 266 590]);
AU22 = AU22(:,[138 266 590]);
AU3 = abs(U2);
AU32 = abs(U22);
AU3 = AU3(:,[431 574 812]);
AU32 = AU32(:,[431 574 812]);
F = [AU1 AU2 AU3];
F2 = [AU12 AU22 AU32];
F = [F F.^2 ones([100 1])];
F2 = [F2 F2.^2 ones([250 1])];
a = zeros([size(F2,1), 1]);
savematrix('features_temp1.txt', [y F])
savematrix('features_temp2.txt', [a F2])