|
@@ -180,11 +180,13 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
this.handleD1Feature(d1Feature, cidFeatureMap);
|
|
|
this.handleD2Feature(vidRankMaps, cidFeatureMap, cidStr);
|
|
|
this.handleH1AndH2Feature(skuFeature, adVerFeature, cidFeatureMap);
|
|
|
-
|
|
|
- cidFeatureMap.put("cid", dto.getCreativeId() != null ? String.valueOf(dto.getCreativeId()) : "");
|
|
|
- cidFeatureMap.put("adid", dto.getAdId() != null ? String.valueOf(dto.getAdId()) : "");
|
|
|
- cidFeatureMap.put("adverid", dto.getAdVerId() != null ? dto.getAdVerId() : "");
|
|
|
- cidFeatureMap.put("profession", dto.getProfession() != null ? dto.getProfession() : "");
|
|
|
+ //只有DNN模型训练过的cid才传入广告相关的稀疏特征
|
|
|
+ if (CollectionUtils.isNotEmpty(DnnCidDataHelper.getCidSet()) && DnnCidDataHelper.getCidSet().contains(adRankItem.getAdId())) {
|
|
|
+ cidFeatureMap.put("cid", dto.getCreativeId() != null ? String.valueOf(dto.getCreativeId()) : "");
|
|
|
+ cidFeatureMap.put("adid", dto.getAdId() != null ? String.valueOf(dto.getAdId()) : "");
|
|
|
+ cidFeatureMap.put("adverid", dto.getAdVerId() != null ? dto.getAdVerId() : "");
|
|
|
+ cidFeatureMap.put("profession", dto.getProfession() != null ? dto.getProfession() : "");
|
|
|
+ }
|
|
|
return adRankItem;
|
|
|
} finally {
|
|
|
cdl1.countDown();
|
|
@@ -264,17 +266,6 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
for (AdRankItem item : result) {
|
|
|
double originalScore = item.getLrScore();
|
|
|
double calibratedScore = originalScore / (originalScore + (1 - originalScore) / negSampleRate);
|
|
|
- // 该创意尚未在模型中训练,打分不可靠
|
|
|
- if (CollectionUtils.isNotEmpty(DnnCidDataHelper.getCidSet()) && !DnnCidDataHelper.getCidSet().contains(item.getAdId())) {
|
|
|
- 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<>());
|
|
|
- double view = Double.parseDouble(b3Feature.getOrDefault("ad_view_14d", "0"));
|
|
|
- double conver = Double.parseDouble(b3Feature.getOrDefault("ad_conversion_14d", "0"));
|
|
|
- double smoothCxr = NumUtil.divSmoothV1(conver, view, 1.64);
|
|
|
- if (smoothCxr < calibratedScore) {
|
|
|
- calibratedScore = smoothCxr;
|
|
|
- }
|
|
|
- }
|
|
|
item.setLrScore(calibratedScore);
|
|
|
item.getScoreMap().put("originCtcvrScore", originalScore);
|
|
|
item.getScoreMap().put("ctcvrScore", calibratedScore);
|