view phase2/treeLinkFeatures.m @ 13:b398be42561d

analysing test data, making sense of the treeLinkFeature output and identifying large number of results with features 1 2 3 4 5
author DaveM
date Fri, 10 Feb 2017 18:13:29 +0000
parents d0bd98e7b6c9
children 0718e03cb36d
line wrap: on
line source
function [linkList, featureList]= treeLinkFeatures(data)
%% linkList = treeLinkFeatures(data)
% given a dataset, a hierarchical cluster of the data is produced, and then
% the data is traversed, such that, for each split in the data, a set of
% features are produced, which are the ranked features that can be used to
% separate the given dataset at that point.


linkList = aglomCluster(data);
listSize = size(data,1);

% linkList(:,4) = 0;
featureList = cell(listSize-1,1);
currentRow = [2*listSize-1];

%%
while (length(currentRow) > 0)
    if(currentRow(1) > listSize) 
        row = currentRow(1) - listSize
        classList = traceLinkageToBinary(linkList, row);
        featureList{row} = rfFeatureSelection(data(classList>0,:), classList(classList>0));
        currentRow = [currentRow(2:end); linkList(row,1); linkList(row,2)];
    else
        currentRow = currentRow(2:end);
    end
end

end