clear all
close all

load ionosphere;
ClassTreeEns = fitensemble(X,Y,'AdaBoostM1',100,'Tree');
rsLoss = resubLoss(ClassTreeEns,'Mode','Cumulative');
plot(rsLoss,'r');
xlabel('Number of Learning Cycles');
rng(2); % For reproducibility
ClassTreeEns = fitensemble(X,Y,'AdaBoostM1',100,'Tree',...
    'Holdout',0.5);
genError = kfoldLoss(ClassTreeEns,'Mode','Cumulative');
hold on
plot(genError,'b');
legend('Training err', 'Test err')
