Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tuia-alg-engineering-py
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mengxiangxuan
tuia-alg-engineering-py
Commits
cc5e108b
Commit
cc5e108b
authored
Mar 27, 2019
by
mxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fc0db678
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
22 deletions
+27
-22
html_model.py
alg-evaluat-system/model_evaluat/html_model.py
+5
-2
roc_ks.py
alg-evaluat-system/model_evaluat/roc_ks.py
+10
-8
candidate_set_new.py
auto-spread/auto_manage/candidate_set_new.py
+2
-2
params_new.py
auto-spread/auto_manage/params_new.py
+10
-10
No files found.
alg-evaluat-system/model_evaluat/html_model.py
View file @
cc5e108b
...
...
@@ -202,8 +202,11 @@ for i in alg_name:
cvr_ks
=
cvr_ks_head
+
cvr_ks_v
+
'</tbody></table>'
cvr_ks_html
=
cvr_ks_html
+
cvr_ks
cvr_roc_ks_html
=
cvr_roc
+
cvr_ks_title
+
cvr_ks_html
html
=
ctr_roc_ks_html
+
cvr_roc_ks_html
end
=
'''<h1> </h1>
<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.write(html)
...
...
alg-evaluat-system/model_evaluat/roc_ks.py
View file @
cc5e108b
...
...
@@ -70,6 +70,8 @@ sql_ctr_roc = '''select ctr_label,pre_ctr,
WHEN rcmd_type=260 THEN 'esmm003'
WHEN rcmd_type=261 THEN 'xDeepFm5'
WHEN rcmd_type=262 THEN 'xDeepFm6'
WHEN rcmd_type=263 THEN 'resource1'
WHEN rcmd_type=264 THEN 'resource2'
END AS rcmd_name
from advert.dws_advert_order_wide_v4_level_6_di
where dt='{}' and pre_ctr is not null
...
...
@@ -126,11 +128,12 @@ sql_cvr_roc = '''select is_target_convert,pre_cvr,
WHEN rcmd_type=260 THEN 'esmm003'
WHEN rcmd_type=261 THEN 'xDeepFm5'
WHEN rcmd_type=262 THEN 'xDeepFm6'
WHEN rcmd_type=263 THEN 'resource1'
WHEN rcmd_type=264 THEN 'resource2'
END AS rcmd_name
from
(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
)
cursor
.
execute
(
sql_ctr_roc
)
...
...
@@ -140,16 +143,15 @@ ctr_roc_data=pd.DataFrame(cursor.fetchall(),
cursor
.
execute
(
sql_cvr_roc
)
cvr_roc_data
=
pd
.
DataFrame
(
cursor
.
fetchall
(),
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
=
[
'alg-4.0.1'
,
'alg-4.0.2'
,
'alg-4.1'
,
'alg-4.2.1'
,
'alg-online-learn223'
,
'alg-app-optimize'
,
'BTM_AND_PC_31'
,
'fix_bias_2'
,
'fix_bias_3'
,
'ffm004'
,
'fnn2'
,
'dcn2'
,
'alg-online-learn223'
,
'alg-app-optimize'
,
'BTM_AND_PC_31'
,
'fix_bias_2'
,
'fix_bias_3'
,
'fnn2'
,
'dcn2'
,
'essm_online1'
,
'Material_reform_online'
,
'xDeepFm4'
,
'essm_deep
3'
,
'essm_deep4
'
]
'xDeepFm4'
,
'essm_deep
4'
,
'resource1'
,
'resource2
'
]
########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
),
...
...
auto-spread/auto_manage/candidate_set_new.py
View file @
cc5e108b
...
...
@@ -152,9 +152,9 @@ sql_ad_slot='''select
avg(pre_cvr) pre_cvr_0,
sum(act_click_cnt)/sum(charge_cnt) stat_cvr_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
and fee>0
and new_trade!='应用分发'
and fee>0
group by app_id,slotid,advert_id
'''
.
format
(
yestoday15
,
yestoday1
)
cursor
.
execute
(
sql_ad_slot
)
...
...
auto-spread/auto_manage/params_new.py
View file @
cc5e108b
...
...
@@ -20,9 +20,9 @@ params_dict={
"wSlotOrientationConfidenceFactor"
:
0.2
,
"wSlotOrientationCostConvertBiasFactor"
:
1.1
,
"bOrientConfidenceFactor"
:
1.0
,
"bOrientCostConvertBiasFactor"
:
1.
2
,
"bOrientCostConvertBiasFactor"
:
1.
1
,
"bSlotOrientationConfidenceFactor"
:
0.5
,
"bSlotOrientationCostConvertBiasFactor"
:
3.
5
"bSlotOrientationCostConvertBiasFactor"
:
3.
0
},
"releaseTarget1feedBackParams"
:
{
"fuse1OrientCostG1dFactor"
:
20000
,
...
...
@@ -38,28 +38,28 @@ params_dict={
"releaseTarget3slotRecommendParams"
:
{
"startFactor"
:
0.
5
,
"cpaBiasRatioFactor"
:
1.
5
,
"startFactor"
:
0.
6
,
"cpaBiasRatioFactor"
:
1.
6
,
"cpaOrientRatioFactor"
:
1.0
,
"cpaBiasThresholdFactor"
:
2.5
,
"cpaBiasThresholdFactor"
:
3.0
,
"cpcTargetRatioFactor"
:
1.0
,
"cpcOrientRatioFactor"
:
0.1
,
"cpcBiasThresholdFactor"
:
1.5
},
"releaseTarget2slotRecommendParams"
:
{
"startFactor"
:
0.5
,
"cpaBiasRatioFactor"
:
0.8
,
"cpaOrientRatioFactor"
:
0.
5
,
"cpaBiasRatioFactor"
:
1.0
,
"cpaOrientRatioFactor"
:
0.
4
,
"cpaBiasThresholdFactor"
:
1.5
,
"cpcTargetRatioFactor"
:
0.8
,
"cpcOrientRatioFactor"
:
0.1
,
"cpcBiasThresholdFactor"
:
1
},
"releaseTarget1slotRecommendParams"
:
{
"startFactor"
:
0.
6
,
"cpaBiasRatioFactor"
:
1.
6
,
"startFactor"
:
0.
8
,
"cpaBiasRatioFactor"
:
1.
8
,
"cpaOrientRatioFactor"
:
1.0
,
"cpaBiasThresholdFactor"
:
3.
0
,
"cpaBiasThresholdFactor"
:
3.
5
,
"cpcTargetRatioFactor"
:
1.0
,
"cpcOrientRatioFactor"
:
0.1
,
"cpcBiasThresholdFactor"
:
1.5
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment