annotate phase2/treeLinkFeatures.m @ 10:686d1f9b8698

bug fixes for treeLinkFeatures, to allow full traversing of a tree, and producing relevant features at each crossing pointWq
author DaveM
date Fri, 10 Feb 2017 12:04:23 +0000
parents 699c769b76da
children 29304e7bfead
rev   line source
DaveM@10 1 function featureList = treeLinkFeatures(data)
DaveM@10 2 %% linkList = treeLinkFeatures(data)
DaveM@10 3 % given a dataset, a hierarchical cluster of the data is produced, and then
DaveM@10 4 % the data is traversed, such that, for each split in the data, a set of
DaveM@10 5 % features are produced, which are the ranked features that can be used to
DaveM@10 6 % separate the given dataset at that point.
DaveM@10 7
DaveM@9 8
DaveM@9 9 linkList = aglomCluster(data);
DaveM@10 10 listSize = size(data,1);
DaveM@9 11
DaveM@10 12 % linkList(:,4) = 0;
DaveM@10 13 featureList = cell(listSize-1,1);
DaveM@10 14 currentRow = [2*listSize-1];
DaveM@9 15
DaveM@9 16
DaveM@10 17 while (length(currentRow) > 0)
DaveM@10 18 currentRow
DaveM@10 19 if(currentRow(1) > listSize-1)
DaveM@10 20 row = currentRow(1) - listSize;
DaveM@10 21 classList = traceLinkageToBinary(linkList, row);
DaveM@10 22 featureList{row} = rfFeatureSelection(data(classList>0,:), classList(classList>0))
DaveM@10 23 currentRow = [currentRow(2:end); linkList(row,1); linkList(row,2)];
DaveM@10 24 else
DaveM@10 25 currentRow = currentRow(2:end);
DaveM@10 26 end
DaveM@9 27 end
DaveM@9 28
DaveM@9 29 end