Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
8612156b
Commit
8612156b
authored
Aug 14, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add getDiaryImpRate in getRate.py
parent
acface15
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
12 deletions
+26
-12
getRate.py
eda/recommended_indexs/getRate.py
+26
-12
No files found.
eda/recommended_indexs/getRate.py
View file @
8612156b
# -*- coding: UTF-8 -*-
import
datetime
from
getAnswerImpRate
import
get_all_answer_imp_rate
,
get_ios_answer_imp_rate
,
get_android_answer_imp_rate
from
getDiaryImpRate
import
get_all_diary_imp_rate
,
get_ios_diary_imp_rate
,
get_android_diary_imp_rate
from
getActivateUidCtr
import
get_all_click_one_rate
,
get_ios_click_one_rate
,
get_android_click_one_rate
from
getClickAnswerUidRate
import
get_all_click_answer_rate
,
get_ios_click_answer_rate
,
get_android_click_answer_rate
from
getClickDiaryUidRate
import
get_all_click_diary_rate
,
get_ios_click_diary_rate
,
get_android_click_diary_rate
...
...
@@ -20,10 +21,11 @@ def result2file(fpath):
内容概览:以下所有数据都是首页的
1. 比例特征
1.1 answer曝光占比(=answer被曝光数/总cid被曝光数)
1.2 活跃用户点击率(=有点击用户点击次数/有点击用户曝光次数)
1.3 点击answer用户占比(=点击answer用户数/曝光answer用户数)
1.4 点击diary用户占比(=点击diary用户数/曝光diary用户数)
1.5 无点击用户占比(=无点击用户数/有曝光用户数)
1.2 diary曝光占比(=diary被曝光数/总cid被曝光数)
1.3 活跃用户点击率(=有点击用户点击次数/有点击用户曝光次数)
1.4 点击answer用户占比(=点击answer用户数/曝光answer用户数)
1.5 点击diary用户占比(=点击diary用户数/曝光diary用户数)
1.6 无点击用户占比(=无点击用户数/有曝光用户数)
2.Top特征
2.1 用户点击次数分布(第一列:用户点击次数;第二列:独立用户数量)
2.2 Top 100 diary (sorted by ctr)
...
...
@@ -49,7 +51,19 @@ def result2file(fpath):
f
.
write
(
'
\n
'
)
print
(
"1.1已将answer曝光占比存入文件"
)
f
.
write
(
"#1.2活跃用户点击率(=有点击用户点击次数/有点击用户曝光次数)
\n
"
)
f
.
write
(
"#1.2diary曝光占比(=diary被曝光数/总cid被曝光数)
\n
"
)
f
.
write
(
tplt
.
format
(
"平台"
,
"diary被曝光数"
,
"总cid被曝光数"
,
"diary被曝光数占比"
))
all_diary_imp_rate
=
get_all_diary_imp_rate
()
ios_diary_imp_rate
=
get_ios_diary_imp_rate
()
android_diary_imp_rate
=
get_android_diary_imp_rate
()
lst
=
[
all_diary_imp_rate
,
ios_diary_imp_rate
,
android_diary_imp_rate
]
for
i
in
lst
:
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
i
[
3
])
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.2已将diary曝光占比存入文件"
)
f
.
write
(
"#1.3活跃用户点击率(=有点击用户点击次数/有点击用户曝光次数)
\n
"
)
f
.
write
(
tplt
.
format
(
"平台"
,
"active用户点击次数"
,
"active用户曝光次数"
,
"active用户点击率"
))
all_click_one_rate
=
get_all_click_one_rate
()
ios_click_one_rate
=
get_ios_click_one_rate
()
...
...
@@ -59,9 +73,9 @@ def result2file(fpath):
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
i
[
3
])
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.
2
已将活跃用户点击率存入文件"
)
print
(
"1.
3
已将活跃用户点击率存入文件"
)
f
.
write
(
"#1.
3
点击answer用户占比(=点击answer用户数/曝光answer用户数)
\n
"
)
f
.
write
(
"#1.
4
点击answer用户占比(=点击answer用户数/曝光answer用户数)
\n
"
)
f
.
write
(
tplt
.
format
(
"平台"
,
"点击answer用户数"
,
"曝光answer用户数"
,
"击answer用户占比"
))
all_click_answer_rate
=
get_all_click_answer_rate
()
ios_click_answer_rate
=
get_ios_click_answer_rate
()
...
...
@@ -71,9 +85,9 @@ def result2file(fpath):
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
i
[
3
])
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.
3
已将点击answer用户占比存入文件"
)
print
(
"1.
4
已将点击answer用户占比存入文件"
)
f
.
write
(
"#1.
4
点击diary用户占比(=点击diary用户数/曝光diary用户数)
\n
"
)
f
.
write
(
"#1.
5
点击diary用户占比(=点击diary用户数/曝光diary用户数)
\n
"
)
f
.
write
(
tplt
.
format
(
"平台"
,
"点击diary用户数"
,
"曝光diary用户数"
,
"击diary用户占比"
))
all_click_diary_rate
=
get_all_click_diary_rate
()
ios_click_diary_rate
=
get_ios_click_diary_rate
()
...
...
@@ -83,9 +97,9 @@ def result2file(fpath):
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
i
[
3
])
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.
4
已将点击diary用户占比存入文件"
)
print
(
"1.
5
已将点击diary用户占比存入文件"
)
f
.
write
(
"#1.
5
无点击用户占比(=无点击用户数/有曝光用户数)
\n
"
)
f
.
write
(
"#1.
6
无点击用户占比(=无点击用户数/有曝光用户数)
\n
"
)
f
.
write
(
tplt
.
format
(
"平台"
,
"no点击用户数"
,
"have曝光用户数"
,
"no点击用户占比"
))
all_click_zero_rate
=
get_all_click_zero_rate
()
ios_click_zero_rate
=
get_ios_click_zero_rate
()
...
...
@@ -95,7 +109,7 @@ def result2file(fpath):
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
i
[
3
])
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.
5
已将无点击用户占比存入文件"
)
print
(
"1.
6
已将无点击用户占比存入文件"
)
def
main
():
...
...
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