Mercurial > hg > sfx-subgrouping
comparison phase2/treeLinkFeatures.m @ 17:c674bf769d82
fix infinite loop bug in tree feature identification
author | DaveM |
---|---|
date | Thu, 16 Feb 2017 10:23:46 +0000 |
parents | 4a8ec6c461a0 |
children | 705e7cd5bee5 |
comparison
equal
deleted
inserted
replaced
16:4a8ec6c461a0 | 17:c674bf769d82 |
---|---|
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,1); | 18 featureList = cell(listSize-1,2); |
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) |
24 row = currentRow(1) - listSize | 24 row = currentRow(1) - listSize; |
25 % rD = linkList(row,4); | |
25 if(linkList(row,4) < depthThresh) | 26 if(linkList(row,4) < depthThresh) |
26 classList = traceLinkageToBinary(linkList, row); | 27 classList = traceLinkageToBinary(linkList, row); |
27 featureList{row} = rfFeatureSelection(data(classList>0,:), classList(classList>0)); | 28 featureList{row,1} = rfFeatureSelection(data(classList>0,:), classList(classList>0)); |
28 currentRow = [currentRow(2:end); linkList(row,1); linkList(row,2)]; | 29 featureList{row,2} = linkList(row,4); |
29 end | 30 end |
30 else | 31 currentRow = [currentRow; linkList(row,1); linkList(row,2)]; |
31 currentRow = currentRow(2:end); | |
32 end | 32 end |
33 currentRow = currentRow(2:end); | |
33 end | 34 end |
34 | 35 |
35 end | 36 end |