Commit cc5e108b authored by mxx's avatar mxx

1

parent fc0db678
...@@ -202,8 +202,11 @@ for i in alg_name: ...@@ -202,8 +202,11 @@ for i in alg_name:
cvr_ks=cvr_ks_head+cvr_ks_v+ '</tbody></table>' cvr_ks=cvr_ks_head+cvr_ks_v+ '</tbody></table>'
cvr_ks_html=cvr_ks_html+cvr_ks cvr_ks_html=cvr_ks_html+cvr_ks
cvr_roc_ks_html=cvr_roc+cvr_ks_title+cvr_ks_html cvr_roc_ks_html=cvr_roc+cvr_ks_title+cvr_ks_html
end='''<h1> </h1>
html=ctr_roc_ks_html+cvr_roc_ks_html <DIV style="BORDER-TOP: #00686b 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></DIV>
<DIV style="BORDER-TOP: #00686b 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></DIV>
'''
html=ctr_roc_ks_html+cvr_roc_ks_html+end
# f=open('a.html','w') # f=open('a.html','w')
# f.write(html) # f.write(html)
......
...@@ -70,6 +70,8 @@ sql_ctr_roc = '''select ctr_label,pre_ctr, ...@@ -70,6 +70,8 @@ sql_ctr_roc = '''select ctr_label,pre_ctr,
WHEN rcmd_type=260 THEN 'esmm003' WHEN rcmd_type=260 THEN 'esmm003'
WHEN rcmd_type=261 THEN 'xDeepFm5' WHEN rcmd_type=261 THEN 'xDeepFm5'
WHEN rcmd_type=262 THEN 'xDeepFm6' WHEN rcmd_type=262 THEN 'xDeepFm6'
WHEN rcmd_type=263 THEN 'resource1'
WHEN rcmd_type=264 THEN 'resource2'
END AS rcmd_name END AS rcmd_name
from advert.dws_advert_order_wide_v4_level_6_di from advert.dws_advert_order_wide_v4_level_6_di
where dt='{}' and pre_ctr is not null where dt='{}' and pre_ctr is not null
...@@ -126,11 +128,12 @@ sql_cvr_roc = '''select is_target_convert,pre_cvr, ...@@ -126,11 +128,12 @@ sql_cvr_roc = '''select is_target_convert,pre_cvr,
WHEN rcmd_type=260 THEN 'esmm003' WHEN rcmd_type=260 THEN 'esmm003'
WHEN rcmd_type=261 THEN 'xDeepFm5' WHEN rcmd_type=261 THEN 'xDeepFm5'
WHEN rcmd_type=262 THEN 'xDeepFm6' WHEN rcmd_type=262 THEN 'xDeepFm6'
WHEN rcmd_type=263 THEN 'resource1'
WHEN rcmd_type=264 THEN 'resource2'
END AS rcmd_name END AS rcmd_name
from from
(select * from advert.dws_advert_order_wide_v5_level_2_di (select * from advert.dws_advert_order_wide_v5_level_2_di
where dt='{}' and charge_cnt>0 and ctr_label=1) a where dt='{}' and charge_cnt>0 and pre_cvr is not null) a
'''.format(dt) '''.format(dt)
cursor.execute(sql_ctr_roc) cursor.execute(sql_ctr_roc)
...@@ -140,16 +143,15 @@ ctr_roc_data=pd.DataFrame(cursor.fetchall(), ...@@ -140,16 +143,15 @@ ctr_roc_data=pd.DataFrame(cursor.fetchall(),
cursor.execute(sql_cvr_roc) cursor.execute(sql_cvr_roc)
cvr_roc_data=pd.DataFrame(cursor.fetchall(), cvr_roc_data=pd.DataFrame(cursor.fetchall(),
columns=['cvr_label','pre_cvr','rcmd_name']) columns=['cvr_label','pre_cvr','rcmd_name'])
cvr_roc_data['cvr_label']=cvr_roc_data['cvr_label'].fillna(value=0)
cvr_roc_data.ix[cvr_roc_data['cvr_label']>0,'cvr_label']=1
#'alg-4.0', #'alg-4.0',
alg=['alg-4.0.1','alg-4.0.2','alg-4.1','alg-4.2.1', alg=['alg-4.0.1','alg-4.0.2','alg-4.1','alg-4.2.1',
'alg-online-learn223', 'alg-online-learn223','alg-app-optimize','BTM_AND_PC_31',
'alg-app-optimize', 'fix_bias_2','fix_bias_3','fnn2','dcn2',
'BTM_AND_PC_31',
'fix_bias_2','fix_bias_3','ffm004',
'fnn2','dcn2',
'essm_online1','Material_reform_online', 'essm_online1','Material_reform_online',
'xDeepFm4','essm_deep3','essm_deep4'] 'xDeepFm4','essm_deep4','resource1','resource2']
########roc曲线###============================================================================= ########roc曲线###=============================================================================
part=[(0,0),(0,1),(0,2),(0,3),(1,0),(1,1),(1,2),(1,3),(2,0),(2,1),(2,2),(2,3),(3,0),(3,1),(3,2),(3,3), part=[(0,0),(0,1),(0,2),(0,3),(1,0),(1,1),(1,2),(1,3),(2,0),(2,1),(2,2),(2,3),(3,0),(3,1),(3,2),(3,3),
......
...@@ -152,9 +152,9 @@ sql_ad_slot='''select ...@@ -152,9 +152,9 @@ sql_ad_slot='''select
avg(pre_cvr) pre_cvr_0, avg(pre_cvr) pre_cvr_0,
sum(act_click_cnt)/sum(charge_cnt) stat_cvr_0, sum(act_click_cnt)/sum(charge_cnt) stat_cvr_0,
avg(pre_cvr)/(sum(act_click_cnt)/sum(charge_cnt)) bias_0 avg(pre_cvr)/(sum(act_click_cnt)/sum(charge_cnt)) bias_0
from advert.dws_advert_order_wide_v4_level_8_di from advert.dws_advert_order_wide_v4_level_3_di
where dt>='{0}' and dt<='{1}' and slotid is not null where dt>='{0}' and dt<='{1}' and slotid is not null
and fee>0 and new_trade!='应用分发' and fee>0
group by app_id,slotid,advert_id group by app_id,slotid,advert_id
'''.format(yestoday15, yestoday1) '''.format(yestoday15, yestoday1)
cursor.execute(sql_ad_slot) cursor.execute(sql_ad_slot)
......
...@@ -20,9 +20,9 @@ params_dict={ ...@@ -20,9 +20,9 @@ params_dict={
"wSlotOrientationConfidenceFactor":0.2, "wSlotOrientationConfidenceFactor":0.2,
"wSlotOrientationCostConvertBiasFactor":1.1, "wSlotOrientationCostConvertBiasFactor":1.1,
"bOrientConfidenceFactor":1.0, "bOrientConfidenceFactor":1.0,
"bOrientCostConvertBiasFactor":1.2, "bOrientCostConvertBiasFactor":1.1,
"bSlotOrientationConfidenceFactor":0.5, "bSlotOrientationConfidenceFactor":0.5,
"bSlotOrientationCostConvertBiasFactor":3.5 "bSlotOrientationCostConvertBiasFactor":3.0
}, },
"releaseTarget1feedBackParams": { "releaseTarget1feedBackParams": {
"fuse1OrientCostG1dFactor":20000, "fuse1OrientCostG1dFactor":20000,
...@@ -38,28 +38,28 @@ params_dict={ ...@@ -38,28 +38,28 @@ params_dict={
"releaseTarget3slotRecommendParams": { "releaseTarget3slotRecommendParams": {
"startFactor":0.5, "startFactor":0.6,
"cpaBiasRatioFactor":1.5, "cpaBiasRatioFactor":1.6,
"cpaOrientRatioFactor":1.0, "cpaOrientRatioFactor":1.0,
"cpaBiasThresholdFactor":2.5, "cpaBiasThresholdFactor":3.0,
"cpcTargetRatioFactor":1.0, "cpcTargetRatioFactor":1.0,
"cpcOrientRatioFactor":0.1, "cpcOrientRatioFactor":0.1,
"cpcBiasThresholdFactor":1.5 "cpcBiasThresholdFactor":1.5
}, },
"releaseTarget2slotRecommendParams": { "releaseTarget2slotRecommendParams": {
"startFactor":0.5, "startFactor":0.5,
"cpaBiasRatioFactor":0.8, "cpaBiasRatioFactor":1.0,
"cpaOrientRatioFactor":0.5, "cpaOrientRatioFactor":0.4,
"cpaBiasThresholdFactor":1.5, "cpaBiasThresholdFactor":1.5,
"cpcTargetRatioFactor":0.8, "cpcTargetRatioFactor":0.8,
"cpcOrientRatioFactor":0.1, "cpcOrientRatioFactor":0.1,
"cpcBiasThresholdFactor":1 "cpcBiasThresholdFactor":1
}, },
"releaseTarget1slotRecommendParams": { "releaseTarget1slotRecommendParams": {
"startFactor":0.6, "startFactor":0.8,
"cpaBiasRatioFactor":1.6, "cpaBiasRatioFactor":1.8,
"cpaOrientRatioFactor":1.0, "cpaOrientRatioFactor":1.0,
"cpaBiasThresholdFactor":3.0, "cpaBiasThresholdFactor":3.5,
"cpcTargetRatioFactor":1.0, "cpcTargetRatioFactor":1.0,
"cpcOrientRatioFactor":0.1, "cpcOrientRatioFactor":0.1,
"cpcBiasThresholdFactor":1.5 "cpcBiasThresholdFactor":1.5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment