comparison analysis/analysisWorkflow.m @ 33:74d123779d3b

create analysis script to prune and write the relevant features for each level - including an 80% classification threshold on the tree - perhaps this can be addressed
author DaveM
date Wed, 15 Mar 2017 16:33:54 +0000
parents
children 781ebde125cf
comparison
equal deleted inserted replaced
32:4bdcab1e821c 33:74d123779d3b
1 diary('AnalysisOutput.txt');
2 dendrogram(linkList);
3 currentRow = [2*listSize-1];
4
5 while (~isempty(currentRow))
6 if(currentRow(1) > listSize)
7 row = currentRow(1) - listSize
8 if(~isempty(featureList{row,1}))
9 % featureList{row,4} = calcLoss(linkList,featureList, row);
10 classList = traceLinkageToBinary(linkList,row);
11 X = data(classList>0,featureList{row,1});
12 Y = classList(classList>0);
13
14 [L,se] = loss(featureList{row,3},X,Y);
15 featureList{row,4} = [L, se];
16
17 pDepth = max(featureList{row,3}.PruneList);
18
19 lossVal = 1;
20 while (lossVal > 0.2 && pDepth > 1)
21 pDepth = pDepth - 1;
22 T1 = prune(featureList{row,3},'Level',pDepth);
23 lossVal = loss(T1,X,Y);
24 end
25 fprintf('Row: %d, pDepth = %d, loss = %f\n',row,pDepth,lossVal);
26 view(T1);
27 currentRow = [currentRow; linkList(row,1); linkList(row,2)];
28 end
29 end
30 currentRow = currentRow(2:end);
31 end
32
33 diary off
34 %%
35