Dear Park,
when you multiply dataset a with the trained pipeline p, you get the dataset with soft outputs (class-conditional probability densities):
>> p
sequential pipeline 2x2 ''
1 sdp_normal 2x2 2 classes, 5 components
>> out=a*p
Banana Set, 100 by 2 dataset with 2 classes: [50 50]
>> +out(1:10,:)
ans =
0.0061 0.0000
0.0056 0.0000
0.0066 0.0000
0.0050 0.0000
0.0021 0.0000
0.0102 0.0000
0.0092 0.0000
0.0065 0.0004
0.0075 0.0000
0.0067 0.0000
To estimate confusion matrix, you must convert these soft outputs into decisions. This means adding an operating point to the pipeline. A default operating point may be added using sdops:
>> pfull=[p sdops(p)]
sequential pipeline 2x1 ''
1 sdp_normal 2x2 2 classes, 5 components
2 sdp_decide 2x1 Weight-based decision (2 classes, 1 ops) at op 1
Now we can run sdconfmat. However, the dataset a (generated by PRTools gendatb) contains numerical class names which is not supported in PRSD Studio.
We use sdrelab to assure the class names are strings:
>> sdconfmat(getlab( sdrelab(a) ),a*pfull)
ans =
True | Decisions
Labels | 1 2 | Totals
-------------------------------------
1 | 48 2 | 50
2 | 1 49 | 50
-------------------------------------
Totals | 49 51 | 100
It’s useful to run sdrelab immediately when you generate the original data using PRTools so you always work with string class names.
>> a=sdrelab(gendatb)
Banana Set, 100 by 2 dataset with 2 classes: [50 50]
Hope it helps,
Pavel