Username Remember Me?
Password   forgot password?
   
   
multiclass support for svc
Posted: 02 July 2009 03:05 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  14
Joined  2009-07-02

Hi,
SVC function seems to work with multiclass problems.
Which schem edoes it implement ? one vs all? pairwise? etc
Are the outputs probabilistic?

Profile
 
 
Posted: 06 July 2009 10:56 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  236
Joined  2008-04-26

Hi idimou,

PRTools svc classifier uses one-against-all strategy when handling multi-class problems.

Yes, the svc output is probabilistic. The raw SVC output is scaled by a sigmoid into 0,1 interval. This output may be considered a classifier-conditional posterior, because the sigmoid is fitted to the classifier outputs. The slope of a sigmoid is optimized by a maximum likelihood estimator (on the same data, may result in some overfit of your data). The position of the sigmoid is fixed so that zero classifier output corresponds to probability of 0.5

To peek into the complete multi-class svc, you might use the PRSD Studio sdconvert command:

>> a=gendatm
Multi
-Class Problem160 by 2 dataset with 8 classes[20  20  20  20  20  20  20  20]

>> w=svc(a,'r',2)
Support Vector Classifier2 to 8 trained  mapping   --> stacked

>> p=sdconvert(w)
sequential pipeline     2x8 'Support Vector Classifier'
 
1  sdp_stack           2x8  

the stack contains 8 SVCs:
>> 
p{1}
stacked pipeline        2x8 
''
 
1  pipeline            2x1  
 2  pipeline            2x1  
 3  pipeline            2x1  
 4  pipeline            2x1  
 5  pipeline            2x1  
 6  pipeline            2x1  
 7  pipeline            2x1  
 8  pipeline            2x1  

to get the first SVC:
>> 
p2=p{1}{1}
sequential pipeline     2x1 
'Feature Selection'
 
1  sdp_svc             2x1  Support Vector Classifier'rbf'par=2.030 SVs
 2  sdp_sigmoid         1x2  scale
=0.18
 3  sdp_fsel            2x1  Feature Selection

>> p{1}{3}
sequential pipeline     2x1 
'Feature Selection'
 
1  sdp_svc             2x1  Support Vector Classifier'rbf'par=2.038 SVs
 2  sdp_sigmoid         1x2  scale
=0.45
 3  sdp_fsel            2x1  Feature Selection

note different scale of the sigmoid

to study raw outputs and sigmoid-scaled outputs on a test set:
>> 
b=gendatm(10)
Multi-Class Problem10 by 2 dataset with 6 classes[1  1  2  1  2  3]

executing only the svc step these are raw outputs:
>> 
out=+b*p2(1)

out =

    
1.3081
   
-1.3444
   
-1.0221
   
-1.0194
   
-1.0206
   
-1.0573
   
-1.0616
   
-1.3247
   
-1.2862
   
-0.9536

executing svc and sigmoid steps:
>> 
out=+b*p2(1:2)

out =

    
0.9992    0.0008
    0.0006    0.9994
    0.0036    0.9964
    0.0037    0.9963
    0.0037    0.9963
    0.0030    0.9970
    0.0029    0.9971
    0.0007    0.9993
    0.0009    0.9991
    0.0053    0.9947

With Best Regards,

Pavel

Profile