matrixTrain = load('primate.train' );
featureInTrain = matrixTrain( :, 1:end-1);
featureOutTrain = matrixTrain(:,end);
matrixTest = load('primate.test' );
featureInTest = matrixTest( :, 1:end-1);
featureOutTest = matrixTest(:,end);
% tree
% t = classregtree(featureInTrain,featureOutTrain,'method','classification');
% predictedOut =str2double( eval(t,featureInTest))
%tree bagger
bnew = TreeBagger(10 ,featureInTrain , featureOutTrain, 'Method','classification') % for 10 tree
predictedOut = predict(bnew, featureInTest)
predictedOut = str2double(predictedOut)
t = bnew.Trees{1,1}
t =bnew.Trees{1,2}
t =bnew.Trees{1,3}
... ... ...
t =bnew.Trees{1,10}
Do you by any chance know how to find the list of observations on each of the leafs (terminal nodes) or the nodes?
ReplyDelete