-
Notifications
You must be signed in to change notification settings - Fork 9
/
cardio_runSVDs_all.m
73 lines (51 loc) · 1.33 KB
/
cardio_runSVDs_all.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
% ñîçäàòü ïðèçíàêè, îñíîâàííûå íà ñëó÷àéíîì 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]);
for t=1:length(S)
if ismember(t, [8 41 96 100]) % èíâåðñèÿ ñèãíàëîâ
x = -S{t};
else
x = +S{t};
end;
[l, u1, u2, u3] = cardio_extracttotalSVD(x);
L(t,:) = l;
U1(t,:) = u1;
U2(t,:) = u2;
U3(t,:) = u3;
disp(t);
end;
L2 = zeros([100 3]);
U21 = zeros([100 1000]);
U22 = zeros([100 1000]);
U23 = zeros([100 1000]);
for t=1:length(S2)
x = +S2{t};
[l, u1, u2, u3] = cardio_extracttotalSVD(x);
L2(t,:) = l;
U21(t,:) = u1;
U22(t,:) = u2;
U23(t,:) = u3;
disp(t);
end;
% ïðèçíàêè
AU1 = abs(U1);
AU21 = abs(U21);
AU1 = AU1(:,[102 232 416 714 781]);
AU21 = AU21(:,[102 232 416 714 781]);
F = [AU1];
F2 = [AU21];
F = [F F.^2 ones([100 1])];
F2 = [F2 F2.^2 ones([250 1])];
a = zeros([size(F2,1), 1]);
savematrix('features_temp_allrand1.txt', [y F])
savematrix('features_temp_allrand2.txt', [a F2])