
load('birds20130709.mat');


w = {
	
	%milvector([],'e')*scalem([],'variance')*loglc2*classc;
	
    scalem([],'variance')*milproxm([],'meanmin')*scalem([],'variance')*loglc2;
    
	
};
wnames = getwnames(w);

%set other parameters and storage:
nrfolds = 5;
nrw = length(w);
err = repmat(NaN,[nrw 2 nrfolds]);

% start the loops:
I = nrfolds;
for i=1:nrfolds
    
	dd_message(3,'%d/%d ',i,nrfolds);
	[x,z,I] = milcrossval(a,I);

	for j=1:nrw
		dd_message(4,'.');
		w_tr = x*w{j};
		out = z*w_tr;
      err(j,1,i) = out*testd;
		err(j,2,i) = dd_auc(out*milroc);
	end
end
dd_message(3,'\n');

% and store everything nicely:
if isempty(wnames) wnames = getwnames(w); end
R = results(err,wnames,{'cl.error' 'AUC'},(1:nrfolds)');
R = setdimname(R,'classifier','dataset','run');
R = setname(R,getname(a));

% And give some output to the command line:
fprintf('\n%s\n\n',repmat('=',1,50));
a
S = average(100*R,3,'max1','dep');
show(S,'text','%4.1f');

