forked from saguo/Image_Classification_Randomforests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplit_test_k.m
More file actions
15 lines (15 loc) · 729 Bytes
/
Copy pathsplit_test_k.m
File metadata and controls
15 lines (15 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
%%%Author Takeshi Kondoh
function output = split_test_k(branch, data, index, output)
% output consists of mmax cells. each cell corresponds to class. each cell
% containes the index of data, which are classified into that class.
% "split" based classifer
if isempty(branch.BL) % if the node is terminal
[~,ind] = max(branch.PQ); % the data classified into ind
output{ind} = [output{ind}; index];
else
par = branch.par;
L = index(data(index,par(1)) < par(2)); % the index of the data which goes to left node
R = index(data(index,par(1)) >= par(2));
output = split_test_k(branch.BL, data, L, output);
output = split_test_k(branch.BR, data, R, output);
end