-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDT_AccVsNoiseLevel.m
55 lines (48 loc) · 2.02 KB
/
DT_AccVsNoiseLevel.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
clear all;
close all force;
%-------------------------------------------------------------------------------
% Loads in the data, and sets up targets/nontargets for the chosen area:
params = SetParams_AccVsNoise();
area = params.area;
genes = filter_nans(area);
[rows, cols] = size(genes);
%-------------------------------------------------------------------------------
% Parameters (!!)
%Check in params file:
%-------------------------------------------------------------------------------
%size sample subset
%area
%(prev best genes) --> numGenes in DT
%-------------------------------------------------------------------------------
%"Translate" params (do this better)
%general fixed
costFunction = params.costFunction;
%general variable
sizeSampleSubset = params.sizeSampleSubset;
AccuracyVsNoise_filename = params.AccuracyVsNoise_filename;
numNoiseIterations = params.numNoiseIterations;
numFolds = params.numFolds;
prevBestGenes = params.prevBestGenes;
numGenes_temp = size(prevBestGenes,1)+1;
%just for this script
noiseLevelSamples = params.noiseLevelSamples;
numNoiseSamples = size(noiseLevelSamples,2);
%-------------------------------------------------------------------------------
% Initialize arrays
topAccuracies = NaN(numNoiseSamples,1);
topAccs_errors = NaN(numNoiseSamples,1);
% Loop through different noise levels
for n = 1:numNoiseSamples
fprintf('(Printed from general) NOISE LEVEL iteration: %d \n', n);
fprintf('Noise lev: %d \n', noiseLevelSamples(n));
[indexOrder, geneNames_ranked, balAcc_ranked, confMatrices_ranked, trees_all_clean, balAcc_errors_ranked] = ...
DT_classification_multiple(sizeSampleSubset, area, prevBestGenes, noiseLevelSamples(n), numFolds, numNoiseIterations);
topAccuracies(n) = balAcc_ranked(1);
topAccs_errors(n) = balAcc_errors_ranked(1);
%save, in case terminates:
save(AccuracyVsNoise_filename)
end
save(AccuracyVsNoise_filename)
% WarnWave = [sin(1:.6:400), sin(1:.7:400), sin(1:.4:400)];
% Audio = audioplayer(WarnWave, 22050);
% play(Audio);