DaveM@33: diary('AnalysisOutput.txt'); DaveM@33: dendrogram(linkList); DaveM@34: listSize = size(data,1); DaveM@33: currentRow = [2*listSize-1]; DaveM@33: DaveM@33: while (~isempty(currentRow)) DaveM@33: if(currentRow(1) > listSize) DaveM@33: row = currentRow(1) - listSize DaveM@33: if(~isempty(featureList{row,1})) DaveM@33: % featureList{row,4} = calcLoss(linkList,featureList, row); DaveM@33: classList = traceLinkageToBinary(linkList,row); DaveM@33: X = data(classList>0,featureList{row,1}); DaveM@33: Y = classList(classList>0); DaveM@33: DaveM@33: [L,se] = loss(featureList{row,3},X,Y); DaveM@33: featureList{row,4} = [L, se]; DaveM@33: DaveM@33: pDepth = max(featureList{row,3}.PruneList); DaveM@33: DaveM@33: lossVal = 1; DaveM@33: while (lossVal > 0.2 && pDepth > 1) DaveM@33: pDepth = pDepth - 1; DaveM@33: T1 = prune(featureList{row,3},'Level',pDepth); DaveM@33: lossVal = loss(T1,X,Y); DaveM@33: end DaveM@33: fprintf('Row: %d, pDepth = %d, loss = %f\n',row,pDepth,lossVal); DaveM@33: view(T1); DaveM@33: currentRow = [currentRow; linkList(row,1); linkList(row,2)]; DaveM@33: end DaveM@33: end DaveM@33: currentRow = currentRow(2:end); DaveM@33: end DaveM@33: DaveM@33: diary off DaveM@33: %% DaveM@33: