|
@@ -260,24 +260,17 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
// getScorerPipeline
|
|
// getScorerPipeline
|
|
List<AdRankItem> result = ScorerUtils.getScorerPipeline(ScorerUtils.PAI_SCORE_CONF_20250214).scoring(sceneFeatureMap, userFeatureMap, adRankItems);
|
|
List<AdRankItem> result = ScorerUtils.getScorerPipeline(ScorerUtils.PAI_SCORE_CONF_20250214).scoring(sceneFeatureMap, userFeatureMap, adRankItems);
|
|
long time5 = System.currentTimeMillis();
|
|
long time5 = System.currentTimeMillis();
|
|
- // calibrate score for negative sampling
|
|
|
|
|
|
+ // calibrate score for negative sampling or cold start
|
|
for (AdRankItem item : result) {
|
|
for (AdRankItem item : result) {
|
|
double originalScore = item.getLrScore();
|
|
double originalScore = item.getLrScore();
|
|
- double calibratedScore;
|
|
|
|
- log.info("cidSet={}", DnnCidDataHelper.getCidSet());
|
|
|
|
- if (CollectionUtils.isNotEmpty(DnnCidDataHelper.getCidSet()) && !DnnCidDataHelper.getCidSet().contains(item.getAdId())) {
|
|
|
|
|
|
+ double calibratedScore = originalScore / (originalScore + (1 - originalScore) / negSampleRate);
|
|
|
|
+ // 该创意尚未在模型中训练,打分不可靠
|
|
|
|
+ if (!DnnCidDataHelper.getCidSet().contains(item.getAdId())) {
|
|
Map<String, Map<String, String>> cidFeature = allCidFeature.getOrDefault(String.valueOf(item.getAdId()), new HashMap<>());
|
|
Map<String, Map<String, String>> cidFeature = allCidFeature.getOrDefault(String.valueOf(item.getAdId()), new HashMap<>());
|
|
Map<String, String> b3Feature = cidFeature.getOrDefault("alg_cid_feature_cid_action", new HashMap<>());
|
|
Map<String, String> b3Feature = cidFeature.getOrDefault("alg_cid_feature_cid_action", new HashMap<>());
|
|
double view = Double.parseDouble(b3Feature.getOrDefault("ad_view_14d", "0"));
|
|
double view = Double.parseDouble(b3Feature.getOrDefault("ad_view_14d", "0"));
|
|
double conver = Double.parseDouble(b3Feature.getOrDefault("ad_conversion_14d", "0"));
|
|
double conver = Double.parseDouble(b3Feature.getOrDefault("ad_conversion_14d", "0"));
|
|
- log.info("not cid view={}, conver={}, cid={}", view, conver, item.getAdId());
|
|
|
|
- if (view <= 0) {
|
|
|
|
- calibratedScore = 0.0;
|
|
|
|
- } else {
|
|
|
|
- calibratedScore = conver / view;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- calibratedScore = originalScore / (originalScore + (1 - originalScore) / negSampleRate);
|
|
|
|
|
|
+ calibratedScore = NumUtil.divSmoothV2(conver, view, CTCVR_SMOOTH_BETA_FACTOR);
|
|
}
|
|
}
|
|
item.setLrScore(calibratedScore);
|
|
item.setLrScore(calibratedScore);
|
|
item.getScoreMap().put("originCtcvrScore", originalScore);
|
|
item.getScoreMap().put("originCtcvrScore", originalScore);
|