source: hep2cells/docombine.m @ 44

Last change on this file since 44 was 40, checked in by dtax, 12 years ago

HEp 2 cell classification, ICPR 2012 competition

File size: 1.6 KB
Line 
1% what do the simple approaches give?
2load cellssimplevar;
3gaborvar_train = a; gaborvar_test = b;
4load cellssimplemax;
5gabormax_train = a; gabormax_test = b;
6load cellssimplemean;
7gabormean_train = a; gabormean_test = b;
8gabor_data=[gabor_train;gabor_test];
9load cells_lbp_mask; gencellsimple
10lbp_train = a; lbp_test = b;
11load cells_lbp_gauss3; gencellsimple
12lbpold_train = a; lbpold_test = b;
13
14
15% param:
16%dim_gabor = size(gabor_train,2);
17%dim_lbp = size(lbp_train,2);
18%dim = dim_gabor+dim_lbp;
19%u = [featsel(dim,1:dim_gabor)*ldc featsel(dim,dim_gabor+(1:dim_lbp))*ldc]*meanc;
20%u = fisherm([],4)*knnc;
21%u = combinerm(ldc([],0,1e-5),gaborvar_train,gabormax_train,gabormean_train,lbp_train,lbpold_train)*ldc([],0,1e-5);
22u = combinerm(loglc2,gaborvar_train,gabormax_train,gabormean_train,lbp_train,lbpold_train)*maxc;
23%u = knnc;
24u = loglc2;
25u = scalem([],'variance')*libsvc;
26
27
28
29% train and test:
30w = [gaborvar_train gabormax_train gabormean_train lbp_train lbpold_train]*u;
31error_on_testset = [gaborvar_test gabormax_test gabormean_test lbp_test lbpold_test]*w*testc
32
33
34% crossval on all data a:
35a = [[gaborvar_train;gaborvar_test] [gabormax_train;gabormax_test] ...
36  [gabormean_train;gabormean_test] [lbp_train;lbp_test] ...
37  [lbpold_train;lbpold_test]];
38
39imlab = getident(a,'image');
40[nlab,baglab] = renumlab(imlab);
41nrfolds = length(baglab); % leave one image out
42
43e = zeros(nrfolds,1);
44Iall = (1:size(nlab,1))';
45
46for i=1:nrfolds
47   Jtst = find(nlab==i);
48   Jtrn = Iall; Jtrn(Jtst)=[];
49
50   i
51   x = a(Jtrn,:);
52   z = a(Jtst,:);
53   %f(i) = find(classsizes(z)>0)
54
55   w = x*u;
56   e(i,1) = z*w*testd;
57   %e(i,1)
58end
59e
60mean(e)
61error_on_testset
62
63
Note: See TracBrowser for help on using the repository browser.