-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcrossvalidation_extra_tree_ensemble.m
More file actions
55 lines (51 loc) · 2.06 KB
/
crossvalidation_extra_tree_ensemble.m
File metadata and controls
55 lines (51 loc) · 2.06 KB
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
49
50
51
52
53
54
function [model] = crossvalidation_extra_tree_ensemble(subset,M,k,nmin,ns,flag,problemType,inputType)
% This function cross-validates an ensemble of Exra-Trees
%
% Inputs:
% subset = observations
% M = number of trees in the ensemble
% k = number of random cut-directions
% nmin = minimum number of points per leaf
% ns = number of folds in the k-fold cross-validation process
% flag = if flag == 1, the model is then evaluated (and saved) on the full dataset
% problemType = specify problem type (1 for regression, zero for classification)
% inputType = binary vector indicating feature type(0:categorical,1:numerical)
% only include input type for classification problems
%
% Output:
% model = structure containing models and performance
%
% Copyright 2015 Ahmad Alsahaf
% Research fellow, Politecnico di Milano
% ahmadalsahaf@gmail.com
%
% Copyright 2014 Stefano Galelli
% Assistant Professor, Singapore University of Technology and Design
% stefano_galelli@sutd.edu.sg
% http://people.sutd.edu.sg/~stefano_galelli/index.html
%
%
% Please refer to README.txt for further information.
%
%
% This file is part of MATLAB_IterativeInputSelection.
%
% MATLAB_IterativeInputSelection 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.
%
% This code 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_IterativeInputSelection.
% If not, see <http://www.gnu.org/licenses/>.
%
if problemType == 0
[model] = crossvalidation_extra_tree_ensemble_r(subset,M,k,nmin,ns,flag);
else
[model] = crossvalidation_extra_tree_ensemble_c(subset,M,k,nmin,ns,inputType,flag);
end