|
@@ -67,7 +67,8 @@ features = [
|
|
|
'lastonehour_play_total', # 过去1小时播放次数
|
|
|
'lastonehour_share_total', # 过去1小时分享次数
|
|
|
'platform_return',
|
|
|
- 'lastonehour_show',
|
|
|
+ 'lastonehour_show', # 不区分地域
|
|
|
+ 'lastonehour_show_region', # 地域分组
|
|
|
]
|
|
|
|
|
|
|
|
@@ -147,6 +148,8 @@ def cal_score(df, param):
|
|
|
df['log_back'] = (df['lastonehour_return'] + 1).apply(math.log)
|
|
|
if param.get('view_type', None) == 'video-show':
|
|
|
df['ctr'] = df['lastonehour_play'] / (df['lastonehour_show'] + 1000)
|
|
|
+ elif param.get('view_type', None) == 'video-show-region':
|
|
|
+ df['ctr'] = df['lastonehour_play'] / (df['lastonehour_show_region'] + 1000)
|
|
|
else:
|
|
|
df['ctr'] = df['lastonehour_play'] / (df['lastonehour_preview'] + 1000)
|
|
|
df['K2'] = df['ctr'].apply(lambda x: 0.6 if x > 0.6 else x)
|