|
@@ -179,6 +179,7 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
this.handleC1UIFeature(midTimeDiffMap, actionStaticMap, cidFeatureMap, cidStr);
|
|
|
this.handleD1Feature(d1Feature, cidFeatureMap);
|
|
|
this.handleD2Feature(vidRankMaps, cidFeatureMap, cidStr);
|
|
|
+ this.handleH1AndH2Feature(cidFeature, adVerFeature, cidFeatureMap);
|
|
|
|
|
|
cidFeatureMap.put("cid", dto.getCreativeId() != null ? String.valueOf(dto.getCreativeId()) : "");
|
|
|
cidFeatureMap.put("adid", dto.getAdId() != null ? String.valueOf(dto.getAdId()) : "");
|
|
@@ -276,14 +277,12 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
|
|
|
double scoreCoefficient = creativeScoreCoefficient.getOrDefault(item.getAdId(), 1d);
|
|
|
double guaranteeScoreCoefficient = getGuaranteeScoreCoefficient(scoreParam, item.getExt());
|
|
|
- double ctcvrScore = item.getLrScore() * scoreCoefficient * item.getCpa();
|
|
|
- item.setScore(ctcvrScore * guaranteeScoreCoefficient);
|
|
|
+ item.setScore(item.getLrScore() * scoreCoefficient * item.getCpa() * guaranteeScoreCoefficient);
|
|
|
item.getScoreMap().put("guaranteeScoreCoefficient", guaranteeScoreCoefficient);
|
|
|
item.getScoreMap().put("cpa", item.getCpa());
|
|
|
item.getScoreMap().put("cpm", item.getCpm());
|
|
|
item.getScoreMap().put("cpmCoefficient", cpmCoefficient);
|
|
|
item.getScoreMap().put("scoreCoefficient", scoreCoefficient);
|
|
|
- item.getScoreMap().put("ctcvrScore", ctcvrScore);
|
|
|
item.getFeatureMap().putAll(userFeatureMap);
|
|
|
item.getFeatureMap().putAll(sceneFeatureMap);
|
|
|
|
|
@@ -559,6 +558,33 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void handleH1AndH2Feature(Map<String, Map<String, String>> cidFeature,
|
|
|
+ Map<String, Map<String, String>> adVerFeature,
|
|
|
+ Map<String, String> cidFeatureMap) {
|
|
|
+ Map<String, String> h1Feature = adVerFeature.getOrDefault("alg_mid_feature_adver_action", new HashMap<>());
|
|
|
+ Map<String, String> h2Feature = adVerFeature.getOrDefault("alg_mid_feature_sku_action", new HashMap<>());
|
|
|
+ List<String> timeList = Arrays.asList("3d", "7d", "30d");
|
|
|
+ List<Tuple2<Map<String, String>, String>> featureList = Arrays.asList(
|
|
|
+ new Tuple2<>(h1Feature, "adverid"),
|
|
|
+ new Tuple2<>(h2Feature, "skuid")
|
|
|
+ );
|
|
|
+ for (Tuple2<Map<String, String>, String> tuple2 : featureList) {
|
|
|
+ Map<String, String> feature = tuple2.f1;
|
|
|
+ String prefix = tuple2.f2;
|
|
|
+ for (String time : timeList) {
|
|
|
+ String timeValue = feature.getOrDefault(time, "");
|
|
|
+ if (StringUtils.isNotEmpty(timeValue)) {
|
|
|
+ String[] split = timeValue.split(",");
|
|
|
+ cidFeatureMap.put("user" + "_" + prefix + "_" + "view" + "_" + time, split[0]);
|
|
|
+ cidFeatureMap.put("user" + "_" + prefix + "_" + "click" + "_" + time, split[1]);
|
|
|
+ cidFeatureMap.put("user" + "_" + prefix + "_" + "conver" + "_" + time, split[2]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void handleD3AndB1Feature(Map<String, String> d3Feature, String cTitle, Map<String, String> featureMap,
|
|
|
ScoreParam scoreParam) {
|
|
|
if (MapUtils.isEmpty(d3Feature) || !d3Feature.containsKey("title") || StringUtils.isEmpty(cTitle)) {
|
|
@@ -735,6 +761,24 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
add("user_vid_share_cate1_14d");
|
|
|
add("user_vid_share_cate2_14d");
|
|
|
add("user_has_conver_1y");
|
|
|
+ add("user_adverid_view_3d");
|
|
|
+ add("user_adverid_click_3d");
|
|
|
+ add("user_adverid_conver_3d");
|
|
|
+ add("user_adverid_view_7d");
|
|
|
+ add("user_adverid_click_7d");
|
|
|
+ add("user_adverid_conver_7d");
|
|
|
+ add("user_adverid_view_30d");
|
|
|
+ add("user_adverid_click_30d");
|
|
|
+ add("user_adverid_conver_30d");
|
|
|
+ add("user_skuid_view_3d");
|
|
|
+ add("user_skuid_click_3d");
|
|
|
+ add("user_skuid_conver_3d");
|
|
|
+ add("user_skuid_view_7d");
|
|
|
+ add("user_skuid_click_7d");
|
|
|
+ add("user_skuid_conver_7d");
|
|
|
+ add("user_skuid_view_30d");
|
|
|
+ add("user_skuid_click_30d");
|
|
|
+ add("user_skuid_conver_30d");
|
|
|
}};
|
|
|
}
|
|
|
|