clear all 
close all

load ionosphere
%34 features, 351 samples, binary classification
Description
pause

rng(100)

%Default MinLeafSize = 1
tc = fitctree(X,Y);
cvmodel = crossval(tc);
cvmodel = fitctree(X,Y,'crossval','on');
view(cvmodel.Trained{1},'Mode','graph')
kfoldLoss(cvmodel)
pause

tc = fitctree(X,Y,'MinLeafSize',10);
cvmodel = crossval(tc);
view(cvmodel.Trained{1},'Mode','graph')
kfoldLoss(cvmodel)
pause

tc = fitctree(X,Y,'MinLeafSize',2);
cvmodel = crossval(tc);
view(cvmodel.Trained{1},'Mode','graph')
kfoldLoss(cvmodel)














% mdl = fitcknn(X,Y,'NumNeighbors',3);
% cvmodel = crossval(mdl);
% kfoldLoss(cvmodel)
% 
% mdl = fitcknn(X,Y,'NumNeighbors',1);
% cvmodel = crossval(mdl);
% kfoldLoss(cvmodel)
% 
% mdl = fitcknn(X,Y,'NumNeighbors',10);
% cvmodel = crossval(mdl);
% kfoldLoss(cvmodel)
