-
Notifications
You must be signed in to change notification settings - Fork 2
/
Example3.asv
55 lines (42 loc) · 1.86 KB
/
Example3.asv
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
% Example 3: Feature selection using iterative procedure
%
% In this Example, feature selection using CAMs is performed in an iterative
% manner. There are 3 steps in the iterative procedure:
% 1) convertion of tabular data to image
% 2) estimating/validating CNN net using training and validations
% sets.
% 3) feature selection using CAMs
% 4) repeating the above 3 steps until a desired number of
% features or max. of 6 stages is reached. At this point,
% terminate the iterative procedure.
%
% Caution: This procedure could take a very long time (depending upon
% your hardware)
%
% Example data: dataset2.mat
clear all;
close all hidden;
% call parameters
% 1. Set up parameters by changing Parameter.m file, otherwise leave it with default values.
% 2. Provide the path of dataset in Parameter.m file by chaning the "Data_path" variable.
DSETnum = 2; %This means the stored data in your defined path is dataset2.mat
Parm = Parameters(DSETnum); % Define parameters for DeepInsight3D and CNN
% NOTE: 1) Set "Parm.miniBatchSize" based on your GPU requirements.
% by default Parm.miniBatchSize = 512.
%
% 2) Set execution environment (for trainingOptions). By default it
% is set to 'multi-gpu'.
Parm.MaxEpochs = 10; % just for quick testing
% Set CAM Threshold
Parm.Threshold=0.3; % varying threshold will change the number of features selected
Glen=inf;
% iterate until desired number of features is obtained or Stage 6 is reach
while (Glen > Parm.DesiredGenes) & (Parm.Stage < 7)
% conversion to image and CNN model estimation
[AUC,C,Accuracy,ValErr] = DeepInsight3D(DSETnum,Parm);
% Feature selection
[Genes,Genes_compressed,G]= func_FS_class_basedCAM(Parm);
% class-based CAM values (used in this paper)
Glen=length(Genes);
Parm.Stage=Parm.Stage+1;
end