1 |
|
---|
2 | load('birds20130709.mat');
|
---|
3 |
|
---|
4 |
|
---|
5 | w = {
|
---|
6 |
|
---|
7 | %milvector([],'e')*scalem([],'variance')*loglc2*classc;
|
---|
8 |
|
---|
9 | scalem([],'variance')*milproxm([],'meanmin')*scalem([],'variance')*loglc2;
|
---|
10 |
|
---|
11 |
|
---|
12 | };
|
---|
13 | wnames = getwnames(w);
|
---|
14 |
|
---|
15 | %set other parameters and storage:
|
---|
16 | nrfolds = 5;
|
---|
17 | nrw = length(w);
|
---|
18 | err = repmat(NaN,[nrw 2 nrfolds]);
|
---|
19 |
|
---|
20 | % start the loops:
|
---|
21 | I = nrfolds;
|
---|
22 | for i=1:nrfolds
|
---|
23 |
|
---|
24 | dd_message(3,'%d/%d ',i,nrfolds);
|
---|
25 | [x,z,I] = milcrossval(a,I);
|
---|
26 |
|
---|
27 | for j=1:nrw
|
---|
28 | dd_message(4,'.');
|
---|
29 | w_tr = x*w{j};
|
---|
30 | out = z*w_tr;
|
---|
31 | err(j,1,i) = out*testd;
|
---|
32 | err(j,2,i) = dd_auc(out*milroc);
|
---|
33 | end
|
---|
34 | end
|
---|
35 | dd_message(3,'\n');
|
---|
36 |
|
---|
37 | % and store everything nicely:
|
---|
38 | if isempty(wnames) wnames = getwnames(w); end
|
---|
39 | R = results(err,wnames,{'cl.error' 'AUC'},(1:nrfolds)');
|
---|
40 | R = setdimname(R,'classifier','dataset','run');
|
---|
41 | R = setname(R,getname(a));
|
---|
42 |
|
---|
43 | % And give some output to the command line:
|
---|
44 | fprintf('\n%s\n\n',repmat('=',1,50));
|
---|
45 | a
|
---|
46 | S = average(100*R,3,'max1','dep');
|
---|
47 | show(S,'text','%4.1f');
|
---|
48 |
|
---|