-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest1MSE.m
68 lines (58 loc) · 2.13 KB
/
test1MSE.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
clear all
close all
clc
load subjectsWithFeatures.mat
%% Divide subjects into diabetic, prediabetic and healthy ones
[diabeticSub,prediabeticSub,healthySub]=splitSubjectsClasses(subjectsWithFeatures);
tot_D=size(diabeticSub,1); % total number of diabetics
tot_P=size(prediabeticSub,1); % total number of prediabetics
tot_H=size(healthySub,1); % total number of healthy subjects
%% Remove subjects with more than missingThreshold % of missing samples
[subjectsWithFeatures,diabeticSub,prediabeticSub,healthySub]=removeMissing(subjectsWithFeatures,15);
tot_subjects=size(subjectsWithFeatures,1); % total number of subjects
tot_D=size(diabeticSub,1); % total number of diabetics
tot_P=size(prediabeticSub,1); % total number of prediabetics
tot_H=size(healthySub,1); % total number of healthy subjects
%% MSE of a specific diabetic subject
subj1=diabeticSub{1,1};
[MSE1]=MSE_complexity_index(subj1);
%% MSE of a specific prediabetic subject
subj2=prediabeticSub{1,1};
[MSE2]=MSE_complexity_index(subj2);
%% MSE of a specific healthy subject
subj3=healthySub{1,1};
[MSE3]=MSE_complexity_index(subj3);
%% Average MSE of the diabetic subjects
for i=1:tot_D
subj_D=diabeticSub{i,1};
[MSE_D]=MSE_complexity_index(subj_D);
MSE_diabetic(i)=MSE_D;
end
MSE_average_diabetic=mean(MSE_diabetic);
MSE_std_diabetic=std(MSE_diabetic);
MSE_SE_diabetic=MSE_std_diabetic/sqrt(tot_D);
%% Average MSE of the prediabetic subjects
for i=1:tot_P
subj_P=prediabeticSub{i,1};
[MSE_P]=MSE_complexity_index(subj_P);
MSE_prediabetic(i)=MSE_P;
end
MSE_average_prediabetic=mean(MSE_prediabetic);
MSE_std_prediabetic=std(MSE_prediabetic);
MSE_SE_prediabetic=MSE_std_prediabetic/sqrt(tot_P);
%% Average MSE of the healthy subjects
for i=1:tot_H
subj_H=healthySub{i,1};
[MSE_H]=MSE_complexity_index(subj_H);
MSE_healthy(i)=MSE_H;
end
MSE_average_healthy=mean(MSE_healthy);
MSE_std_healthy=std(MSE_healthy);
MSE_SE_healthy=MSE_std_healthy/sqrt(tot_H);
%%
%% new features: MSE
for i=1:1%numel(glucotypesSubjects)
subj=glucotypesSubjects{i,1};
[MSEvalues]=MSE_complexity_index(subj);
glucotypesSubjects{i,1}.features.variability.MSEvalues=MSEvalues;
end