Mercurial > hg > sfx-subgrouping
changeset 9:699c769b76da
initial implementation of treeLinkFeatures, to be tested
author | DaveM |
---|---|
date | Fri, 10 Feb 2017 09:03:05 +0000 |
parents | b177d57ac0bd |
children | 686d1f9b8698 |
files | phase2/aglomCluster.m phase2/treeLinkFeatures.m |
diffstat | 2 files changed, 18 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/phase2/aglomCluster.m Fri Feb 10 08:28:22 2017 +0000 +++ b/phase2/aglomCluster.m Fri Feb 10 09:03:05 2017 +0000 @@ -1,4 +1,4 @@ -function aglomCluster(data, clusterMethod, distanceMetric, numClusters) +function linkList = aglomCluster(data, clusterMethod, distanceMetric, numClusters) %% aglomCluster(data, clusterMethod, distanceMetric, numClusters) % This function performs aglomerative clustering on a given data set, % allowing the interpretation of a hierarchical data, and plotting a @@ -56,7 +56,7 @@ distMap = pdist(data, distanceMetric); linkList = linkage(distMap, clusterMethod); -[~,T] = dendrogram(linkList,numClusters); +% [~,T] = dendrogram(linkList,numClusters); end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phase2/treeLinkFeatures.m Fri Feb 10 09:03:05 2017 +0000 @@ -0,0 +1,16 @@ +function linkList = treeLinkFeatures(data) + +linkList = aglomCluster(data); + +linkList(:,4) = 0; +listSize = size(data,1); +currentRow = [size(linkList,1)]; + + +while (linkList(currentRow(1),1) > listSize && linkList(currentRow(1),2) > listSize) + classList = traceLinkageToBinary(linkList, currentRow); + linkList(:,4) = rfFeatureSelection(data(classList>0,:), classList(classList>0)); + currentRow = [currentRow(2:end); currentRow(1),1; currentRow(1),2]; +end + +end \ No newline at end of file