Last change
on this file since 137 was
40,
checked in by dtax, 12 years ago
|
HEp 2 cell classification, ICPR 2012 competition
|
File size:
904 bytes
|
Line | |
---|
1 | % what do the simple approaches give? |
---|
2 | load cellssimplemax; |
---|
3 | %load cells_lbp_gauss3; gencellsimple |
---|
4 | xtrain = a; xtest = b; |
---|
5 | a = [a;b]; |
---|
6 | |
---|
7 | %% add the different orientations... |
---|
8 | %b = a(:,1); |
---|
9 | %for i=0:7 |
---|
10 | % I = 1+((i*4):(i*4+3)); |
---|
11 | % b = [b mean(a(:,I),2)]; |
---|
12 | %end |
---|
13 | %b = a; |
---|
14 | %a = a(:,[1:5]); |
---|
15 | |
---|
16 | |
---|
17 | % param: |
---|
18 | %u = scalem([],'variance')*knnc([],1); |
---|
19 | %u = fisherm([],4)*knnc; |
---|
20 | %u = scalem([],'variance')*parzenc; |
---|
21 | %u = fisherc; |
---|
22 | %u = ldc; |
---|
23 | u = scalem([],'variance')*libsvc; |
---|
24 | |
---|
25 | % train and test: |
---|
26 | w = xtrain*u; |
---|
27 | error_on_testset = xtest*w*testd |
---|
28 | |
---|
29 | |
---|
30 | % crossval on a: |
---|
31 | imlab = getident(a,'image'); |
---|
32 | [nlab,baglab] = renumlab(imlab); |
---|
33 | nrfolds = length(baglab); % leave one image out |
---|
34 | |
---|
35 | e = zeros(nrfolds,1); |
---|
36 | Iall = (1:size(nlab,1))'; |
---|
37 | |
---|
38 | for i=1:nrfolds |
---|
39 | Jtst = find(nlab==i); |
---|
40 | Jtrn = Iall; Jtrn(Jtst)=[]; |
---|
41 | |
---|
42 | x = a(Jtrn,:); |
---|
43 | z = a(Jtst,:); |
---|
44 | % f(i) = find(classsizes(z)>0) |
---|
45 | |
---|
46 | w = x*u; |
---|
47 | e(i,1) = z*w*testd; |
---|
48 | end |
---|
49 | e |
---|
50 | mean(e) |
---|
51 | error_on_testset |
---|
52 | |
---|
53 | |
---|
Note: See
TracBrowser
for help on using the repository browser.