%% adaboost_ex % Adaboost 2D examples based on perceptrons and decision stumps % % should be in the path. % % % See http://37steps.com/prtools for more. %% Generate simple 2D examples randreset; % for reproducability a = prdataset([gencirc(100);gencirc(100)*0.5],genlab([100 100])); a = setprior(a,0); delfigs %% Run adaboost, 200 iterations, linear peceptron as weak classifier figure; w = adaboostc(a,perlc([],1),200,[],1); title('200 base classifiers: single epoch linear perceptron'); fontsize(14); figure; scatterd(a); plotc(w) title('Result adaboost, 200 weak classifiers combined'); fontsize(14); %% Run adaboost, 200 iterations, decision stump as weak classifier figure; w = adaboostc(a,stumpc,200,[],3); title('200 base classifiers: single epoch decision stump'); fontsize(14); figure; scatterd(a); plotc(w) title('Result adaboost, 200 weak classifiers combined'); fontsize(14); %showfigs