www.gusucode.com > stats 源码程序 matlab案例代码 > stats/EsimtateThekfoldMarginsOfAClassifierExample.m
%% Esimtate the _k_-fold Margins of a Classifier % Find the _k_-fold margins for an ensemble that classifies the % |ionosphere| data. %% % Load the |ionosphere| data set. % Copyright 2015 The MathWorks, Inc. load ionosphere %% % Train a classification ensemble of decision trees. Mdl = fitensemble(X,Y,'AdaBoostM1',100,'Tree'); %% % Cross validate the classifier using 10-fold cross validation. cvens = crossval(Mdl); %% % Compute the _k_fold margins. Disaply summary statistics for the margins. m = kfoldMargin(cvens); marginStats = table(min(m),mean(m),max(m),... 'VariableNames',{'Min','Mean','Max'})