comparison phase2/treeLinkFeatures.m @ 24:8613ec5ab369

include output with decision tree output
author DaveM
date Wed, 08 Mar 2017 16:56:59 +0000
parents 30db29d5cf5c
children 2a77dd12582f
comparison
equal deleted inserted replaced
23:30db29d5cf5c 24:8613ec5ab369
13 linkList = aglomCluster(data); 13 linkList = aglomCluster(data);
14 linkList = depthCheck(linkList); 14 linkList = depthCheck(linkList);
15 listSize = size(data,1); 15 listSize = size(data,1);
16 16
17 % linkList(:,4) = 0; 17 % linkList(:,4) = 0;
18 featureList = cell(listSize-1,2); 18 featureList = cell(listSize-1,3);
19 currentRow = [2*listSize-1]; 19 currentRow = [2*listSize-1];
20 20
21 %% 21 %%
22 while (~isempty(currentRow)) 22 while (~isempty(currentRow))
23 if(currentRow(1) > listSize) 23 if(currentRow(1) > listSize)
25 % rD = linkList(row,4); 25 % rD = linkList(row,4);
26 if(linkList(row,4) < depthThresh) 26 if(linkList(row,4) < depthThresh)
27 classList = traceLinkageToBinary(linkList, row); 27 classList = traceLinkageToBinary(linkList, row);
28 featureList{row,1} = rfFeatureSelection(data(classList>0,:), classList(classList>0)); 28 featureList{row,1} = rfFeatureSelection(data(classList>0,:), classList(classList>0));
29 featureList{row,2} = linkList(row,4); 29 featureList{row,2} = linkList(row,4);
30 featureList{row,3} = fitctree(data(classList>0,featureList{row,1}),classList(classList>0),'PredictorNames',featureNames(featureList{row,1}));
30 end 31 end
31 currentRow = [currentRow; linkList(row,1); linkList(row,2)]; 32 currentRow = [currentRow; linkList(row,1); linkList(row,2)];
32 end 33 end
33 currentRow = currentRow(2:end); 34 currentRow = currentRow(2:end);
34 end 35 end