Username Remember Me?
Password   forgot password?
   
   
confusion matrix error
Posted: 14 May 2009 11:43 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  25
Joined  2009-04-17

Sir,

>> a=gendatb
Intrusion Detection DataSet, 100 by 2 dataset with 2 classes: [50 50]
>> [tr,ts]=gendat(a,0.8)
Intrusion Detection DataSet, 80 by 2 dataset with 2 classes: [40 40]
Intrusion Detection DataSet, 20 by 2 dataset with 2 classes: [10 10]
>> p=sdmixture(a)
...
...
sequential pipeline 2x2 ‘’
1 sdp_normal 2x2 2 classes, 2 components

AFTER THIS WHEN I TYPE THE FOLLOWING , ERROR APPEARS AS FOLLOWS:

>> sdconfmat(getlab(a),sddecide(a*p))
??? Error using ==> sdconfmat at 120
wrong input parameters

>> sdconfmat(getlab(ts),sddecide(ts*p))
??? Error using ==> sdconfmat at 120
wrong input parameters

Profile
 
 
Posted: 14 May 2009 11:55 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  236
Joined  2008-04-26

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 classes5 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 classes5 components
 2  sdp_decide          2x1  Weight
-based decision (2 classes1 opsat 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(getlabsdrelab(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 Set100 by 2 dataset with 2 classes[50  50]

Hope it helps,

Pavel

[ Edited: 14 May 2009 11:58 AM by pavel]
Profile
 
 
Posted: 14 May 2009 12:14 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  25
Joined  2009-04-17

Thanks Pavel.
Yes. It works.

Profile
 
 
Posted: 15 October 2009 06:41 AM   [ Ignore ]   [ # 3 ]  
Newbie
Rank
Total Posts:  1
Joined  2009-10-15

Thanks a lot it is really a great help for us.It really work.
foxdrg
Simulation prêt

Profile