annotate phase2/treeLinkFeatures.m @ 15:0718e03cb36d

update runme for phase 2
author DaveM
date Wed, 15 Feb 2017 11:07:32 +0000
parents d0bd98e7b6c9
children 4a8ec6c461a0
rev   line source
DaveM@11 1 function [linkList, 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@12 16 %%
DaveM@15 17 while (~isempty(currentRow))
DaveM@12 18 if(currentRow(1) > listSize)
DaveM@11 19 row = currentRow(1) - listSize
DaveM@10 20 classList = traceLinkageToBinary(linkList, row);
DaveM@11 21 featureList{row} = rfFeatureSelection(data(classList>0,:), classList(classList>0));
DaveM@10 22 currentRow = [currentRow(2:end); linkList(row,1); linkList(row,2)];
DaveM@10 23 else
DaveM@10 24 currentRow = currentRow(2:end);
DaveM@10 25 end
DaveM@9 26 end
DaveM@9 27
DaveM@9 28 end