changeset 24:8613ec5ab369

include output with decision tree output
author DaveM
date Wed, 08 Mar 2017 16:56:59 +0000
parents 30db29d5cf5c
children 2a77dd12582f
files phase2/traceLinkageToBinary.m phase2/treeLinkFeatures.m
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/phase2/traceLinkageToBinary.m	Wed Mar 08 13:17:07 2017 +0000
+++ b/phase2/traceLinkageToBinary.m	Wed Mar 08 16:56:59 2017 +0000
@@ -12,13 +12,18 @@
 listSize = size(linkList,1)+1;
 c(1) = linkList(rowIndex,1);
 c(2) = linkList(rowIndex,2);
+for i = 1:2
+    if (c(i) > listSize)
+        c(i) = c(i) - listSize;
+    end
+end
 
 leafList1 = traverseDownOneStep(linkList,[],c(1));
 leafList2 = traverseDownOneStep(linkList,[],c(2));
 
 classList = zeros(listSize,1);
-classList(leafList1) = 1;
-classList(leafList2) = 2;
+classList(leafList1) = c(1);
+classList(leafList2) = c(2);
 
 
 end
--- a/phase2/treeLinkFeatures.m	Wed Mar 08 13:17:07 2017 +0000
+++ b/phase2/treeLinkFeatures.m	Wed Mar 08 16:56:59 2017 +0000
@@ -15,7 +15,7 @@
 listSize = size(data,1);
 
 % linkList(:,4) = 0;
-featureList = cell(listSize-1,2);
+featureList = cell(listSize-1,3);
 currentRow = [2*listSize-1];
 
 %%
@@ -27,6 +27,7 @@
             classList = traceLinkageToBinary(linkList, row);
             featureList{row,1} = rfFeatureSelection(data(classList>0,:), classList(classList>0));
             featureList{row,2} = linkList(row,4);
+            featureList{row,3} = fitctree(data(classList>0,featureList{row,1}),classList(classList>0),'PredictorNames',featureNames(featureList{row,1}));
         end
         currentRow = [currentRow; linkList(row,1); linkList(row,2)];
     end