|
@@ -10,7 +10,7 @@ def ad_recommend_predict(mid, video_id):
|
|
广告推荐预测
|
|
广告推荐预测
|
|
:param mid: mid
|
|
:param mid: mid
|
|
:param video_id: video_id
|
|
:param video_id: video_id
|
|
- :return: ad_predict, type-int, 1-发放广告,0-不发放广告
|
|
|
|
|
|
+ :return: ad_predict, type-int, 1-发放广告,2-不发放广告
|
|
"""
|
|
"""
|
|
now_date = datetime.datetime.today()
|
|
now_date = datetime.datetime.today()
|
|
now_dt = datetime.datetime.strftime(now_date, '%Y%m%d')
|
|
now_dt = datetime.datetime.strftime(now_date, '%Y%m%d')
|
|
@@ -48,6 +48,6 @@ def ad_recommend_predict(mid, video_id):
|
|
if mid_video_share_rate > threshold:
|
|
if mid_video_share_rate > threshold:
|
|
ad_predict = 1
|
|
ad_predict = 1
|
|
else:
|
|
else:
|
|
- ad_predict = 0
|
|
|
|
|
|
+ ad_predict = 2
|
|
result = {'mid_video_share_rate': mid_video_share_rate, 'threshold': threshold, 'ad_predict': ad_predict}
|
|
result = {'mid_video_share_rate': mid_video_share_rate, 'threshold': threshold, 'ad_predict': ad_predict}
|
|
return result
|
|
return result
|