1、要解决的问题
模型有3个输出分数分别是
s
c
o
r
e
1
score_1
score1,
s
c
o
r
e
2
score_2
score2,
s
c
o
r
e
3
score_3
score3,需要加权融合成最终的一个输出
s
c
o
r
e
score
score
s
c
o
r
e
=
w
1
∗
s
c
o
r
e
1
+
w
2
∗
s
c
o
r
e
2
+
w
3
∗
s
c
o
r
e
3
score = w_1*score_1+w_2*score_2 + w_3*score_3
score=w1∗score1+w2∗score2+w3∗score3
2、如何求出合适的 w w w 参数呢?
假设现有知识为
- task1 -> s o c r e 1 socre_1 socre1 -> l a b e l 1 label_1 label1
- task2 -> s o c r e 2 socre_2 socre2 -> l a b e l 2 label_2 label2
- task3 -> s o c r e 3 socre_3 socre3 -> l a b e l 3 label_3 label3
先定义融合后的 s c o r e score score 为: s c o r e = w 1 ∗ s c o r e 1 + w 2 ∗ s c o r e 2 + w 3 ∗ s c o r e 3 score = w_1*score_1+w_2*score_2 + w_3*score_3 score=w1∗score1+w2∗score2+w3∗score3,分别计算 3 task 的 label 基于融合 score 的 auc 表现:
- a u c 1 = c a l _ a u c ( l a b e l 1 , s c o r e ) auc_1=cal\_auc(label_1, score) auc1=cal_auc(label1,score)
- a u c 2 = c a l _ a u c ( l a b e l 2 , s c o r e ) auc_2=cal\_auc(label_2, score) auc2=cal_auc(label2,score)
- a u c 3 = c a l _ a u c ( l a b e l 3 , s c o r e ) auc_3=cal\_auc(label_3, score) auc3=cal_auc(label3,score)
进而计算整体的 auc,怎么算呢?将上面 3 task 的 auc 进行简单算术平均,也就是:
m e a n _ a u c = ( i a u c 1 + a u c 2 + a u c 3 ) 3 mean\_auc =\frac{ (iauc_1 + auc_2 + auc_3)}{3} mean_auc=3(iauc1+auc2+auc3)
3、总结
通过对 w w w 参数的搜索,可以得到每次 w w w 参数下 m e a n a u c mean_auc meanauc 的表现,从而搜索出 n n n 个 t a s k task task 对应 s c o r e score score 的最优权重。