融合排序的快速调参实验

问题背景

在平安的时候会经常对比多个模型的效果,也会加很多规则系数做模型排序,做推荐的时候粗排需要对多个维度进行打分,
例如 score = 模型1 * 0.5 + 模型2 * 0.3 + 模型3 * 0.2
similar = 年龄 * 0.2 + 性别 * 0.1 + 地区 * 0.5
搜索结果pair得分 = es_score * 0.3 + ann_score * 0.5 + edit_distance * 0.1 + svd_score * 0.1
其中feature的系数冷启动很难设置,需要多次ABTest实验确定参数,而ABTest实验参数比较多、配置复杂

解决方案

使用一套语法来描述各种特征之间的关系,适合冷启动、多实验并行、可扩展
套路:设计一种新的描述语言,通过json配置化做实验

   Example 1:
   x := if (y < z) y + 3;

   Example 2:
   x := if (y < z)
        {
          y + 3
        }
   Example 3:
   # 推荐视频单条视频得分
   score_pair_similar := if ($user_area=$item_area or $user_area='北京')
               {
                   $score1 *= 0.3 
               }
              if($user_age < 20)
               {
                   $score2 = min($score_21, $score_22)
               }
               if($user_type = new or $item_tyep = new)
               {
                  $score3 *= 1.5
               }
               return $score1 + $score2 + $score3
   total_score := $score_pair_similar + $score5
   test_a : {
        条件:hash($user_id) % 100 < 50
        key1 : $score1
        key2 : $score2
   }
   test_b: {
        条件:$user_area = ‘北京’
        key1: $score1
        key2: $score2
   }

最后根据条件对用户进行分桶实验并埋点,确定最优系数组合
目前公司有内部项目同时进行数万ab实验,github也有很多开源项目,例如:https://github.com/ArashPartow/exprtk

posted @ 2021-11-12 11:14  致林  阅读(45)  评论(0编辑  收藏  举报