liqian 2 lat temu
rodzic
commit
7a40e13f27
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      ad_recommend.py

+ 3 - 3
ad_recommend.py

@@ -10,7 +10,7 @@ def ad_recommend_predict(mid, video_id):
     广告推荐预测
     :param mid: mid
     :param video_id: video_id
-    :return: ad_predict, type-int, 1-发放广告,2-发放广告
+    :return: ad_predict, type-int, 1-发放广告,2-发放广告
     """
     now_date = datetime.datetime.today()
     now_dt = datetime.datetime.strftime(now_date, '%Y%m%d')
@@ -46,8 +46,8 @@ def ad_recommend_predict(mid, video_id):
         threshold = float(threshold)
     # 阈值判断
     if mid_video_share_rate > threshold:
-        ad_predict = 1
-    else:
         ad_predict = 2
+    else:
+        ad_predict = 1
     result = {'mid_video_share_rate': mid_video_share_rate, 'threshold': threshold, 'ad_predict': ad_predict}
     return result