Dear Lisanne,
I see. In the upcoming perClass 5.1, sdsvc adds a ‘prob’ option for the two-class case, that uses the Platt algorithm (used by libSVM).
I’m attaching the sdsvc.m and sdsvc.p files you can drop in perclass directory replacing the old ones.
For details on estimating probabilities from SVM output, check out: https://www.csie.ntu.edu.tw/~cjlin/papers/svmprob/svmprob.pdf
Kind Regards,
Pavel
>> load fruit
>> b=a(:,:,1:2)
'Fruit set' 200 by 2 sddata, 2 classes: 'apple'(100) 'banana'(100)
>> rand('state',42); p=sdsvc(b,'rbf','C',1,'prob')
....................sigma=0.86471 C=1 err=0.020 SVs=41
sequential pipeline 2x1 'Scaling+Support Vector Machine'
1 Scaling 2x2 standardization
2 Support vector machine 2x1 RBF kernel, sigma=0.86, 41 SVs
3 Scaling 1x1
4 Probability scaling 1x2
5 Decision 2x1 weighting, 2 classes
>> out=b*-p
'Fruit set' 200 by 2 sddata, 2 classes: 'apple'(100) 'banana'(100)
>> +out(1:10)
ans =
0.9861 0.0139
0.9966 0.0034
0.9903 0.0097
0.9903 0.0097
0.9922 0.0078
0.9865 0.0135
0.9663 0.0337
0.9867 0.0133
0.9898 0.0102
0.9688 0.0312
>> sdscatter(a,-p)
Kind Regards,
Pavel
sdsvc.p (File Size: 4KB - Downloads: 79)
sdsvc.m (File Size: 3KB - Downloads: 93)