|
@@ -83,7 +83,8 @@ public class ThompsonSamplingModel extends Model {
|
|
|
|
|
|
public double score(AdRankItem adRankItem, String ctrOrCVR) {
|
|
|
double score = 0.0f;
|
|
|
- AdActionFeature adActionFeature = this.thompsonSamplingModel.get(adRankItem.getAdId());
|
|
|
+ AdActionFeature adActionFeature = this.thompsonSamplingModel.getOrDefault(adRankItem.getAdId(),new AdActionFeature());
|
|
|
+
|
|
|
if (ctrOrCVR.equals("ctr")){
|
|
|
int alpha_ctr = (int) adActionFeature.getAdClick() + this.alpha ;
|
|
|
int beta_ctr = this.beta_click + (int)adActionFeature.getAdView() - (int)adActionFeature.getAdClick();
|