-
Notifications
You must be signed in to change notification settings - Fork 7
/
predictWithExtraTree.m
49 lines (45 loc) · 1.58 KB
/
predictWithExtraTree.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function [ output ] = predictWithExtraTree(TREE,S,problemType)
%
% This function performs a recursive search within the Extra-Tree
% and returns the estimate for each pattern in S.
%
% Inputs :
% TREE = the Extra-Tree
% S = dataset of attribute patterns
% problemType = specify problem type (1 for regression, zero for classification)
%
%
% Outputs :
% output = output produced by the Extra-Tree for each pattern
%
%
%
% Copyright 2015 Ahmad Alsahaf
% Research fellow, Politecnico di Milano
% ahmadalsahaf@gmail.com
%
% Copyright 2014 Riccardo Taormina
% Ph.D. Student, Hong Kong Polytechnic University
% riccardo.taormina@gmail.com
%
% Please refer to README.txt for bibliographical references on Extra-Trees!
%
% This file is part of MATLAB_ExtraTrees
%
% MATLAB_ExtraTrees is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% MATLAB_ExtraTrees is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with MATLAB_ExtraTrees_classification. If not, see <http://www.gnu.org/licenses/>.
if problemType == 0
output = predictWithExtraTree_r(TREE,S);
else
output = predictWithExtraTree_c(TREE,S);
end