|
@@ -117,6 +117,7 @@ public class VideoAdThompsonScorerV2 {
|
|
|
adIdList.forEach(creativeDTO -> {
|
|
|
redisKey.add(redisCreativeStatisticsPrefix+creativeDTO.getCreativeId());
|
|
|
});
|
|
|
+ //view/sum(view)
|
|
|
List<String> values=redisHelper.getValues(redisKey);
|
|
|
int i=0;
|
|
|
double score=0d;
|
|
@@ -132,7 +133,7 @@ public class VideoAdThompsonScorerV2 {
|
|
|
}else {
|
|
|
statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
|
|
|
score = betaSampler(exp665Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) ,
|
|
|
- exp665Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
|
|
|
+ (exp665Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())))/ (1+exp665Param.getOrDefault("beta_k",9d));
|
|
|
}
|
|
|
score=score*dto.getCpa()*dto.getBid1()*dto.getBid2();
|
|
|
item.setScore(score);
|
|
@@ -177,15 +178,18 @@ public class VideoAdThompsonScorerV2 {
|
|
|
score = betaSampler(exp666Param.getOrDefault("alpha",1d),exp666Param.getOrDefault("beta",100000d));
|
|
|
}else {
|
|
|
statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
|
|
|
- score = betaSampler(exp666Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) , exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
|
|
|
+ score = betaSampler(exp666Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) ,
|
|
|
+ (exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp()))/(1+exp666Param.getOrDefault("beta_k",9d))) ;
|
|
|
}
|
|
|
}else {
|
|
|
statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
|
|
|
if(Double.parseDouble(statistic.getExp())>exp666Param.getOrDefault("viewThreshold",5000d)){
|
|
|
- score = betaSampler(1d+Long.parseLong(statistic.getOrder()) , exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
|
|
|
+ score = betaSampler(1d+Long.parseLong(statistic.getOrder()) ,
|
|
|
+ (exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp()))/(1+exp666Param.getOrDefault("beta_k",9d))) ;
|
|
|
} else if( values.get(i)!=null) {
|
|
|
statistic =gson.fromJson(values.get(i),CreativeStatistic.class);
|
|
|
- score = betaSampler(exp666Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) , exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
|
|
|
+ score = betaSampler(exp666Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) ,
|
|
|
+ (exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp()))/(1+exp666Param.getOrDefault("beta_k",9d))) ;
|
|
|
}else {
|
|
|
score = betaSampler(exp666Param.getOrDefault("alpha",1d),exp666Param.getOrDefault("beta",100000d));
|
|
|
}
|
|
@@ -255,13 +259,13 @@ public class VideoAdThompsonScorerV2 {
|
|
|
return cpa;
|
|
|
}
|
|
|
}
|
|
|
- double betaSampler(double alpha, double beta) {
|
|
|
+ double betaSampler(double alpha, double beta) {
|
|
|
BetaDistribution betaSample = new BetaDistribution(alpha, beta);
|
|
|
return betaSample.sample();
|
|
|
}
|
|
|
@Value("${ad.engine.new.thompson.exp.V2.663:{\"randomMin\":0.000001,\"randomMax\":0.00001,\"alpha\":1,\"beta\":10000}}")
|
|
|
public void setExp663Param(String str){
|
|
|
- this.exp663Param=gson.fromJson(str,Map.class);
|
|
|
+ this.exp663Param=gson.fromJson(str,Map.class);
|
|
|
}
|
|
|
@Value("${ad.engine.new.thompson.exp.V2.664:{}}")
|
|
|
public void setExp664Param(String str){
|