www.gusucode.com > stats 源码程序 matlab案例代码 > stats/EstimateOutOfBagErrorExample.m

    %% Estimate Out-Of-Bag Error
%%
% Load Fisher's iris data set.
load fisheriris
%%
% Grow a bag of 100 classification trees.
rng(1) % For reproducibility
ens = fitensemble(meas,species,'Bag',100,'Tree','type','classification');
%%
% Estimate the out-of-bag classification error.
L = oobLoss(ens)