-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinitial_preprocessing.m
69 lines (58 loc) · 2.19 KB
/
initial_preprocessing.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
%% Initial preprocessing of feature array Section
clear;
load('feature_arr');
load('..\Preprocessed_EEG\label.mat');
new_l = repmat(label,1,45); % create outputs for all observations
%% remove constant (or almost constant features)
not_const = removeconstantrows(ftr_arr',0.002);
%% z-normalization of each feature
obs = zscore(not_const');
fs = size(obs,2);
labels = new_l';
save('normalized_obs','obs');
save('labels_v2','labels');
%% ReliefF Section
fprintf('Entering RelieF calculation Section\n');
for nbr = 5:5:30,
[ranked_relieff,~] = relieff(obs,labels,nbr,'method','classification');
save(['reliefF_features_',num2str(nbr)],'ranked_relieff');
end
%% Cohen's f^2 Section
fprintf('Entering Cohen f^2 calculation Section\n');
ranked_cohen = cohen_f_squared(obs, labels);
save('cohen_features','ranked_cohen');
%% mRMR Section
fprintf('Entering mRMR calculation Section\n');
% only 823 features to be used and maybe to put both mrmr_q
[ranked_q_mrmr,ranked_d_mrmr] = mrmr_calculation(obs, labels, 823);
save(['mrmr_features_',num2str(823)],'ranked_d_mrmr','ranked_q_mrmr');
%% FCBF Section
fprintf('Entering fcbf calculation Section\n');
count = 1;
for delta=0.005:0.005:0.03,
ranked_fcbf = FCBF(obs,labels,delta);
save(['fcbf_features_',num2str(count)],'ranked_fcbf');
count = count + 1;
end
%% infFS Section
fprintf('Entering infFS calculation Section\n');
count = 1;
for a = 0.1:0.1:1,
for init = 1:9,
if init<7,
load(['reliefF_features_',num2str(5*init)]);
[ranked_infFS, ~] = infFS( obs(:,ranked_relieff(1:1646)), labels, a, 0, 1 );
elseif init==7,
load('mrmr_features_823');
[ranked_infFS, ~] = infFS( obs(:,ranked_d_mrmr), labels, a, 0, 1 );
elseif init==8,
load('mrmr_features823');
[ranked_infFS, ~] = infFS( obs(:,ranked_q_mrmr), labels, a, 0, 1 );
else
load('cohen_features');
[ranked_infFS, ~] = infFS( obs(:,ranked_cohen(1:1646)), labels, a, 0, 1 );
end
save(['infFS_features_',num2str(count),'_',num2str(init)],'ranked_infFS');
end
count = count + 1;
end