Dear rensheng911,
your question is perfectly clear. You can use the labeld command to get classifier decisions. Here is the example:
% lets first train our classifier
>> a=gendatb
Banana Set, 100 by 2 dataset with 2 classes: [50 50]
>> w=ldc(a)
Bayes-Normal-1, 2 to 2 trained mapping --> normal_map
% now we come up with a test set
>> ts=gendatb
Banana Set, 100 by 2 dataset with 2 classes: [50 50]
% to get an error estimate, apply the testc:
>> error=ts*w*testc
error =
0.1500
% to get decisions, use the labeld command:
>> dec=ts*w*labeld;
% dec now contains a decision for each sample in ts
>> dec(1:10,:)
ans =
1
2
2
1
2
1
2
1
1
1
% both testc and labeld work on the "soft" output of the trained classifier
% which is a dataset. In each feature (column), it contains similarity (confidence)
% with respect to one class:
>> out=ts*w
Banana Set, 100 by 2 dataset with 2 classes: [50 50]
>> +out(1:10,:)
ans =
0.0075 0.0003
0.0009 0.0079
0.0013 0.0064
0.0047 0.0001
0.0006 0.0074
0.0019 0.0001
0.0002 0.0090
0.0025 0.0000
0.0049 0.0001
0.0025 0.0001
Hope it helps,
Pavel