source: prextra/comparch2.m @ 6

Last change on this file since 6 was 5, checked in by bduin, 14 years ago
File size: 1.3 KB
RevLine 
[5]1
2function ee = comparch2(type,L,n,iter)
3
4if nargin < 4, iter = 25; end
5if nargin < 3 | isempty(n), n = 50; end
6if nargin < 2, L = []; end
7
8W = classfs;
9if ~isempty(L), W = W(L); end
10
11rand('state',0);
12ee.names = getname(W{1});
13for j=2:length(W)
14        ee.names = char(ee.names,getname(W{j}));
15end
16
17learnsizes = n;
18       
19e = zeros(length(W),length(learnsizes),iter);
20b = genarche(type,1000,0);
21for j=1:iter
22        for m = 1:length(learnsizes)
23                a = genarche(type,learnsizes(m),j);
24                for i=1:length(W)
25                        e(i,m,j) = b*(a*W{i})*testc;
26                        disp([j,m,i])
27                end
28        end
29end
30
31ee.error = e;
32ee.iter = iter;
33ee.learnsizes = learnsizes;
34
35disp(type)
36disp(' ')
37for m = 1:length(learnsizes)
38        em = mean(squeeze(e(:,m,:))');
39        es = std(squeeze(e(:,m,:))');
40        [eem,J] = sort(em);
41        for i=1:length(W)
42                fprintf(1,'%7.4f %8.5f   %s \n',em(J(i)),es(J(i))/sqrt(iter),ee.names(J(i),:));
43        end
44end
45
46if isempty(L) % full set, store result
47        save([type '_' num2str(iter) '_' num2str(learnsizes(1))],'ee');
48end
49
50%figure;
51%scatterd(genarche(type,200,0));
52%axis equal
53%fsave('scatter_plot',14,2,5,1.5);
54%ee.error = mean(e,3);
55%ee.xvalues = learnsizes;
56%ee.std = std(e,[],3)/sqrt(iter);
57%plotr(ee,[],[],[],'errorbar')
58%save(['arch2_' getmapping_file(W{n})],'ee','iter');
59
60                       
Note: See TracBrowser for help on using the repository browser.