Mercurial > hg > d-case-event
comparison metrics_computation.m @ 1:3ea8ed09af0f tip
additional clarifications
author | Dimitrios Giannoulis |
---|---|
date | Wed, 13 Mar 2013 11:57:24 +0000 |
parents | 22b10c5b72e8 |
children |
comparison
equal
deleted
inserted
replaced
0:22b10c5b72e8 | 1:3ea8ed09af0f |
---|---|
108 load(['results' Annotators{ANOT_FLAG} '/results02.mat']) | 108 load(['results' Annotators{ANOT_FLAG} '/results02.mat']) |
109 r2 = results; | 109 r2 = results; |
110 load(['results' Annotators{ANOT_FLAG} '/results03.mat']) | 110 load(['results' Annotators{ANOT_FLAG} '/results03.mat']) |
111 r3 = results; | 111 r3 = results; |
112 | 112 |
113 % Calculate mean F-measure values for all development set audio files: | |
113 Fmeasure_EB = []; Fmeasure_CWEB = []; Fmeasure_FB = []; | 114 Fmeasure_EB = []; Fmeasure_CWEB = []; Fmeasure_FB = []; |
114 for i=1:size(results,1) | 115 for i=1:size(results,1) |
115 Fmeasure_EB(i)=(r1{i,1}.F+r2{i,1}.F+r3{i,1}.F)/3; | 116 Fmeasure_EB(i)=(r1{i,1}.F+r2{i,1}.F+r3{i,1}.F)/3; |
116 Fmeasure_CWEB(i)=(r1{i,2}.F+r2{i,2}.F+r3{i,2}.F)/3; | 117 Fmeasure_CWEB(i)=(r1{i,2}.F+r2{i,2}.F+r3{i,2}.F)/3; |
117 Fmeasure_FB(i)=(r1{i,3}.F+r2{i,3}.F+r3{i,3}.F)/3; | 118 Fmeasure_FB(i)=(r1{i,3}.F+r2{i,3}.F+r3{i,3}.F)/3; |
118 end | 119 end |
119 | 120 |
121 % Choose the combination of system parameters that maximizes each metric | |
120 [valEB, posEB] = max(Fmeasure_EB); | 122 [valEB, posEB] = max(Fmeasure_EB); |
121 [valCWEB, posCWEB] = max(Fmeasure_CWEB); | 123 [valCWEB, posCWEB] = max(Fmeasure_CWEB); |
122 [valFB, posFB] = max(Fmeasure_FB); | 124 [valFB, posFB] = max(Fmeasure_FB); |
123 | 125 |
126 % Collect the names of the system versions that produced the maximum F-measure | |
127 % for each metric | |
124 res = {results{posEB,1}.name; valEB; results{posCWEB,2}.name; valCWEB ... | 128 res = {results{posEB,1}.name; valEB; results{posCWEB,2}.name; valCWEB ... |
125 ;results{posFB,3}.name; valFB}; | 129 ;results{posFB,3}.name; valFB}; |
126 | 130 |
127 % THE FOLLOWING COMPUTES ALL THE METRICS FOR EACH EVAL CASE AND THE OPTIMAL | 131 % THE FOLLOWING COMPUTES ALL THE METRICS FOR EACH EVAL CASE AND THE OPTIMAL |
128 % PARAMETERS | 132 % PARAMETERS |
129 'EB' | 133 % Event Based 'EB' |
130 all_res_EB = {(r1{posEB,1}.Rec+r2{posEB,1}.Rec+r3{posEB,1}.Rec)/3; | 134 all_res_EB = {(r1{posEB,1}.Rec+r2{posEB,1}.Rec+r3{posEB,1}.Rec)/3; |
131 (r1{posEB,1}.Pre+r2{posEB,1}.Pre+r3{posEB,1}.Pre)/3; | 135 (r1{posEB,1}.Pre+r2{posEB,1}.Pre+r3{posEB,1}.Pre)/3; |
132 (r1{posEB,1}.F+r2{posEB,1}.F+r3{posEB,1}.F)/3; | 136 (r1{posEB,1}.F+r2{posEB,1}.F+r3{posEB,1}.F)/3; |
133 (r1{posEB,1}.AEER+r2{posEB,1}.AEER+r3{posEB,1}.AEER)/3; | 137 (r1{posEB,1}.AEER+r2{posEB,1}.AEER+r3{posEB,1}.AEER)/3; |
134 (r1{posEB,1}.RecOff+r2{posEB,1}.RecOff+r3{posEB,1}.RecOff)/3; | 138 (r1{posEB,1}.RecOff+r2{posEB,1}.RecOff+r3{posEB,1}.RecOff)/3; |
135 (r1{posEB,1}.PreOff+r2{posEB,1}.PreOff+r3{posEB,1}.PreOff)/3; | 139 (r1{posEB,1}.PreOff+r2{posEB,1}.PreOff+r3{posEB,1}.PreOff)/3; |
136 (r1{posEB,1}.FOff+r2{posEB,1}.FOff+r3{posEB,1}.FOff)/3; | 140 (r1{posEB,1}.FOff+r2{posEB,1}.FOff+r3{posEB,1}.FOff)/3; |
137 (r1{posEB,1}.AEEROff+r2{posEB,1}.AEEROff+r3{posEB,1}.AEEROff)/3}; | 141 (r1{posEB,1}.AEEROff+r2{posEB,1}.AEEROff+r3{posEB,1}.AEEROff)/3}; |
138 'CWEB' | 142 % Class-wise Event Based 'CWEB' |
139 all_res_CWEB = {(r1{posCWEB,2}.Rec+r2{posCWEB,2}.Rec+r3{posCWEB,2}.Rec)/3; | 143 all_res_CWEB = {(r1{posCWEB,2}.Rec+r2{posCWEB,2}.Rec+r3{posCWEB,2}.Rec)/3; |
140 (r1{posCWEB,2}.Pre+r2{posCWEB,2}.Pre+r3{posCWEB,2}.Pre)/3; | 144 (r1{posCWEB,2}.Pre+r2{posCWEB,2}.Pre+r3{posCWEB,2}.Pre)/3; |
141 (r1{posCWEB,2}.F+r2{posCWEB,2}.F+r3{posCWEB,2}.F)/3; | 145 (r1{posCWEB,2}.F+r2{posCWEB,2}.F+r3{posCWEB,2}.F)/3; |
142 (r1{posCWEB,2}.AEER+r2{posCWEB,2}.AEER+r3{posCWEB,2}.AEER)/3; | 146 (r1{posCWEB,2}.AEER+r2{posCWEB,2}.AEER+r3{posCWEB,2}.AEER)/3; |
143 (r1{posCWEB,2}.RecOff+r2{posCWEB,2}.RecOff+r3{posCWEB,2}.RecOff)/3; | 147 (r1{posCWEB,2}.RecOff+r2{posCWEB,2}.RecOff+r3{posCWEB,2}.RecOff)/3; |
144 (r1{posCWEB,2}.PreOff+r2{posCWEB,2}.PreOff+r3{posCWEB,2}.PreOff)/3; | 148 (r1{posCWEB,2}.PreOff+r2{posCWEB,2}.PreOff+r3{posCWEB,2}.PreOff)/3; |
145 (r1{posCWEB,2}.FOff+r2{posCWEB,2}.FOff+r3{posCWEB,2}.FOff)/3; | 149 (r1{posCWEB,2}.FOff+r2{posCWEB,2}.FOff+r3{posCWEB,2}.FOff)/3; |
146 (r1{posCWEB,2}.AEEROff+r2{posCWEB,2}.AEEROff+r3{posCWEB,2}.AEEROff)/3}; | 150 (r1{posCWEB,2}.AEEROff+r2{posCWEB,2}.AEEROff+r3{posCWEB,2}.AEEROff)/3}; |
147 'FB' | 151 % Frame Based 'FB' |
148 all_res_FB = {(r1{posFB,3}.Rec+r2{posFB,3}.Rec+r3{posFB,3}.Rec)/3; | 152 all_res_FB = {(r1{posFB,3}.Rec+r2{posFB,3}.Rec+r3{posFB,3}.Rec)/3; |
149 (r1{posFB,3}.Pre+r2{posFB,3}.Pre+r3{posFB,3}.Pre)/3; | 153 (r1{posFB,3}.Pre+r2{posFB,3}.Pre+r3{posFB,3}.Pre)/3; |
150 (r1{posFB,3}.F+r2{posFB,3}.F+r3{posFB,3}.F)/3; | 154 (r1{posFB,3}.F+r2{posFB,3}.F+r3{posFB,3}.F)/3; |
151 (r1{posFB,3}.AEER+r2{posFB,3}.AEER+r3{posFB,3}.AEER)/3; | 155 (r1{posFB,3}.AEER+r2{posFB,3}.AEER+r3{posFB,3}.AEER)/3; |
152 NaN; | 156 '-'; |
153 NaN; | 157 '-'; |
154 NaN; | 158 '-'; |
155 NaN;}; | 159 '-';}; |
156 ALL_METRICS = [all_res_EB, all_res_CWEB, all_res_FB] | 160 |
161 COMP_METRICS = [{'Rec';'Pre';'F';'AEER';'RecOff';'PreOff';'FOff';'AEEROff'},all_res_EB, all_res_CWEB, all_res_FB]; | |
162 | |
163 disp('Computed metrics for the Event Based (EB) [column 2],') | |
164 disp('the Class-wise Event Based (CWEB) [column 3],') | |
165 disp('and the Frame Based (FB) [column 4]') | |
166 disp(COMP_METRICS) | |
167 | |
168 % system version names | |
169 % disp(res) |