|
@@ -112,24 +112,40 @@ public class VideoAdThompsonModel extends Model{
|
|
|
modelCache.put(videoId+"_"+creativeId, adActionFeature);
|
|
|
}
|
|
|
|
|
|
- public double ctrScore(AdRankItem item) {
|
|
|
+ public double scoreByView1000(AdRankItem item) {
|
|
|
AdActionFeature adActionFeature = this.featureCache.getOrDefault(item.getVideoId()+"_"+item.getAdId(), new AdActionFeature());
|
|
|
+ double alpha_score=0d;
|
|
|
+ double beta_score=0d;
|
|
|
if(adActionFeature.getAdView()<1000){
|
|
|
adActionFeature=this.adActionFeatureMap.getOrDefault(item.getAdId(), new AdActionFeature());
|
|
|
+ alpha_score = adActionFeature.getAdConversion() + this.alpha_conv;
|
|
|
+ beta_score = this.beta_conversion + adActionFeature.getAdView() - adActionFeature.getAdConversion();
|
|
|
+ }else {
|
|
|
+ AdActionFeature videoAdFeature=this.videoAdActionFeatureMap.getOrDefault(item.getVideoId(),new AdActionFeature());
|
|
|
+ double k=(videoAdFeature.getAdConversion()+videoAdFeature.getAdView())/1000d;
|
|
|
+ double alpha=(videoAdFeature.getAdConversion())/k;
|
|
|
+ alpha_score =adActionFeature.getAdConversion() + alpha;
|
|
|
+ beta_score = 1000d + adActionFeature.getAdView() - adActionFeature.getAdConversion();
|
|
|
}
|
|
|
- double alpha_ctr = (int) adActionFeature.getAdClick() + this.alpha_click;
|
|
|
- double beta_ctr = this.beta_click + (int) adActionFeature.getAdView() - (int) adActionFeature.getAdClick();
|
|
|
- return this.betaSampler(alpha_ctr, beta_ctr);
|
|
|
+ return this.betaSampler(alpha_score, beta_score);
|
|
|
}
|
|
|
|
|
|
- public double cvrScore(AdRankItem item) {
|
|
|
+ public double scoreByView500(AdRankItem item) {
|
|
|
AdActionFeature adActionFeature = this.featureCache.getOrDefault(item.getVideoId()+"_"+item.getAdId(), new AdActionFeature());
|
|
|
- if(adActionFeature.getAdView()<1000){
|
|
|
+ double alpha_score=0d;
|
|
|
+ double beta_score=0d;
|
|
|
+ if(adActionFeature.getAdView()<500){
|
|
|
adActionFeature=this.adActionFeatureMap.getOrDefault(item.getAdId(), new AdActionFeature());
|
|
|
+ alpha_score = adActionFeature.getAdConversion() + this.alpha_conv;
|
|
|
+ beta_score = this.beta_conversion + adActionFeature.getAdView() - adActionFeature.getAdConversion();
|
|
|
+ }else {
|
|
|
+ AdActionFeature videoAdFeature=this.videoAdActionFeatureMap.getOrDefault(item.getVideoId(),new AdActionFeature());
|
|
|
+ double k=(videoAdFeature.getAdConversion()+videoAdFeature.getAdView())/1000d;
|
|
|
+ double alpha=(videoAdFeature.getAdConversion())/k;
|
|
|
+ alpha_score =adActionFeature.getAdConversion() + alpha;
|
|
|
+ beta_score = 1000d + adActionFeature.getAdView() - adActionFeature.getAdConversion();
|
|
|
}
|
|
|
- double alpha_cvr = (int) adActionFeature.getAdConversion() + 10d;
|
|
|
- double beta_cvr = 100d + (int) adActionFeature.getAdClick() - (int) adActionFeature.getAdConversion();
|
|
|
- return this.betaSampler(alpha_cvr, beta_cvr);
|
|
|
+ return this.betaSampler(alpha_score, beta_score);
|
|
|
}
|
|
|
|
|
|
public double score(AdRankItem item) {
|
|
@@ -147,7 +163,6 @@ public class VideoAdThompsonModel extends Model{
|
|
|
alpha_score =adActionFeature.getAdConversion() + alpha;
|
|
|
beta_score = 1000d + adActionFeature.getAdView() - adActionFeature.getAdConversion();
|
|
|
}
|
|
|
-
|
|
|
return this.betaSampler(alpha_score, beta_score);
|
|
|
}
|
|
|
|