annotate analysis/analysisWorkflow.m @ 37:d9a9a6b93026 tip

Add README
author DaveM
date Sat, 01 Apr 2017 17:03:14 +0100
parents 781ebde125cf
children
rev   line source
DaveM@33 1 diary('AnalysisOutput.txt');
DaveM@33 2 dendrogram(linkList);
DaveM@34 3 listSize = size(data,1);
DaveM@33 4 currentRow = [2*listSize-1];
DaveM@33 5
DaveM@33 6 while (~isempty(currentRow))
DaveM@33 7 if(currentRow(1) > listSize)
DaveM@33 8 row = currentRow(1) - listSize
DaveM@33 9 if(~isempty(featureList{row,1}))
DaveM@33 10 % featureList{row,4} = calcLoss(linkList,featureList, row);
DaveM@33 11 classList = traceLinkageToBinary(linkList,row);
DaveM@33 12 X = data(classList>0,featureList{row,1});
DaveM@33 13 Y = classList(classList>0);
DaveM@33 14
DaveM@33 15 [L,se] = loss(featureList{row,3},X,Y);
DaveM@33 16 featureList{row,4} = [L, se];
DaveM@33 17
DaveM@33 18 pDepth = max(featureList{row,3}.PruneList);
DaveM@33 19
DaveM@33 20 lossVal = 1;
DaveM@33 21 while (lossVal > 0.2 && pDepth > 1)
DaveM@33 22 pDepth = pDepth - 1;
DaveM@33 23 T1 = prune(featureList{row,3},'Level',pDepth);
DaveM@33 24 lossVal = loss(T1,X,Y);
DaveM@33 25 end
DaveM@33 26 fprintf('Row: %d, pDepth = %d, loss = %f\n',row,pDepth,lossVal);
DaveM@33 27 view(T1);
DaveM@33 28 currentRow = [currentRow; linkList(row,1); linkList(row,2)];
DaveM@33 29 end
DaveM@33 30 end
DaveM@33 31 currentRow = currentRow(2:end);
DaveM@33 32 end
DaveM@33 33
DaveM@33 34 diary off
DaveM@33 35 %%
DaveM@33 36