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
0efaebd8
Commit
0efaebd8
authored
Aug 13, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
增加执行环境
parents
1d45c955
35b29f97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
getRate.py
eda/recommended_indexs/code/getRate.py
+3
-3
getTop100Question.py
eda/recommended_indexs/code/getTop100Question.py
+1
-1
main.py
eda/test/main.py
+2
-1
No files found.
eda/recommended_indexs/code/getRate.py
View file @
0efaebd8
...
...
@@ -20,7 +20,7 @@ def result2file(fpath):
内容概览:以下所有数据都是首页的
1. 比例特征
1.1 answer曝光占比(=answer被曝光数/总cid被曝光数)
1.2 活跃用户点击率(=
活跃用户点击次数/活跃
用户曝光次数)
1.2 活跃用户点击率(=
有点击用户点击次数/有点击
用户曝光次数)
1.3 点击answer用户占比(=点击answer用户数/曝光answer用户数)
1.4 点击diary用户占比(=点击diary用户数/曝光diary用户数)
1.5 无点击用户占比(=无点击用户数/有曝光用户数)
...
...
@@ -28,7 +28,7 @@ def result2file(fpath):
2.1 用户点击次数分布(第一列:用户点击次数;第二列:独立用户数量)
2.2 Top 100 diary (sorted by ctr)
2.3 Top 100 Answer (sorted by ctr)
2.4 Top 100 Question (sorted by c
lick times
)
2.4 Top 100 Question (sorted by c
tr
)
...
...
@@ -49,7 +49,7 @@ def result2file(fpath):
f
.
write
(
'
\n
'
)
print
(
"1.1已将answer曝光占比存入文件"
)
f
.
write
(
"#1.2活跃用户点击率(=
活跃用户点击次数/活跃
用户曝光次数)
\n
"
)
f
.
write
(
"#1.2活跃用户点击率(=
有点击用户点击次数/有点击
用户曝光次数)
\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
()
...
...
eda/recommended_indexs/code/getTop100Question.py
View file @
0efaebd8
...
...
@@ -21,7 +21,7 @@ def tuple2dict(tuple_result):
def
result2file
(
result_lst
,
fpath
):
with
open
(
fpath
,
'w'
)
as
f
:
tplt
=
"{0:
\u3000
<4}
\t
{1:
\u3000
<12}
\t
{2:
\u3000
^6}
\t
{3:
\u3000
^6}
\t
{4:
\u3000
<8}
\t
{5:
\u3000
^15}
\n
"
f
.
write
(
"2.4 Top 100 Question
(曝光表里cid类型没有question,因此下面的曝光数和点击率都为0)
\n
"
)
f
.
write
(
"2.4 Top 100 Question
\n
"
)
f
.
write
(
"=================================================================
\n
"
)
f
.
write
(
tplt
.
format
(
"平台"
,
"question_id"
,
"点击数"
,
"曝光数"
,
"点击率"
,
"question链接"
))
for
i
in
result_lst
:
...
...
eda/test/main.py
View file @
0efaebd8
...
...
@@ -29,6 +29,7 @@ def main():
activate_uid_ctr_all
=
get_activate_uid_ctr
(
"all"
)
activate_uid_ctr_ios
=
get_activate_uid_ctr
(
"ios"
)
activate_uid_ctr_android
=
get_activate_uid_ctr
(
"android"
)
activate_uid_ctr_result
=
[
activate_uid_ctr_all
,
activate_uid_ctr_ios
,
activate_uid_ctr_android
]
print
(
"已获取活跃用户点击率"
)
#1.4 点击answer用户占比(=点击answer用户数/曝光answer用户数)
...
...
@@ -79,7 +80,7 @@ def main():
output_path
=
DIRECTORY_PATH
+
"result_{}.txt"
.
format
(
get_yesterday_date
())
with
open
(
output_path
,
'w'
)
as
f
:
...
...
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