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
6bc7b2c7
Commit
6bc7b2c7
authored
Aug 21, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Plain Diff
update predictDiaryLocal file
parents
605673e8
2c84f241
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
8 deletions
+56
-8
func.py
eda/recommended_indexs_v2/func.py
+1
-1
main.py
eda/recommended_indexs_v2/main.py
+55
-7
No files found.
eda/recommended_indexs_v2/func.py
View file @
6bc7b2c7
...
...
@@ -78,7 +78,7 @@ def get_click_zero_uid_rate_detail(platform):
dct2
=
get_register_uid_count
()
result
=
{}
for
k
in
dct1
:
result
[
k
]
=
dct1
[
k
]
/
dct2
[
k
]
result
[
k
]
=
round
(
dct1
[
k
]
/
dct2
[
k
],
4
)
return
result
...
...
eda/recommended_indexs_v2/main.py
View file @
6bc7b2c7
...
...
@@ -168,11 +168,16 @@ def result2file():
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
f
.
write
(
"#1.8无点击用户数分布(=无点击用户∩激活用户 / 激活用户数) #注意:(]里面的数字指的是距离当前时间的天数
\n
"
)
f
.
write
(
"平台"
+
'
\t
'
+
"0-7"
+
'
\t
'
+
"7-14"
+
'
\t
'
+
\
"14-30"
+
'
\t
'
+
"30-60"
+
'
\t
'
+
"60-90"
+
'
\t
'
+
"90+"
+
'
\n
'
)
f
.
write
(
"平台"
+
'
\t
\t
'
+
"0-7"
+
'
\t\t
'
+
"7-14"
+
'
\t
\t
'
+
\
"14-30"
+
'
\t
\t
'
+
"30-60"
+
'
\t\t
'
+
"60-90"
+
'
\t
\t
'
+
"90+"
+
'
\n
'
)
for
i
in
click_zero_uid_detail_result
:
f
.
write
(
i
[
"platform"
]
+
'
\t
'
+
str
(
i
[
"0-7"
])
+
'
\t
'
+
str
(
i
[
"7-14"
])
+
'
\t
'
+
str
(
i
[
"14-30"
])
+
\
'
\t
'
+
str
(
i
[
"30-60"
])
+
'
\t
'
+
str
(
i
[
"60-90"
])
+
'
\t
'
+
str
(
i
[
"90+"
])
+
'
\n
'
)
f
.
write
(
i
[
"platform"
]
+
'
\t\t
'
+
\
"{}
%
"
.
format
(
round
(
i
[
"0-7"
]
*
100
,
2
))
+
'
\t\t
'
+
\
"{}
%
"
.
format
(
round
(
i
[
"7-14"
]
*
100
,
2
))
+
'
\t\t
'
+
\
"{}
%
"
.
format
(
round
(
i
[
"14-30"
]
*
100
,
2
))
+
'
\t\t
'
+
\
"{}
%
"
.
format
(
round
(
i
[
"30-60"
]
*
100
,
2
))
+
'
\t\t
'
+
\
"{}
%
"
.
format
(
round
(
i
[
"60-90"
]
*
100
,
2
))
+
'
\t\t
'
+
\
"{}
%
"
.
format
(
round
(
i
[
"90+"
]
*
100
,
2
))
+
'
\n
'
)
f
.
write
(
'
\n\n\n
'
)
#==========================================================================================
tplt
=
"{0:^10}
\t
{1:^10}
\n
"
...
...
@@ -192,7 +197,7 @@ def result2file():
f
.
write
(
header
)
for
i
in
top_diary_result
:
for
j
in
i
:
f
.
write
(
tplt
.
format
(
j
[
0
],
j
[
1
],
j
[
2
],
j
[
3
],
j
[
4
]
,
j
[
5
]))
f
.
write
(
tplt
.
format
(
j
[
0
],
j
[
1
],
j
[
2
],
j
[
3
],
"{}
%
"
.
format
(
round
(
j
[
4
]
*
100
,
2
))
,
j
[
5
]))
f
.
write
(
sep
)
if
i
!=
top_diary_result
[
-
1
]:
f
.
write
(
header
)
...
...
@@ -204,7 +209,7 @@ def result2file():
f
.
write
(
header
)
for
i
in
top_answer_result
:
for
j
in
i
:
f
.
write
(
tplt
.
format
(
j
[
0
],
j
[
1
],
j
[
2
],
j
[
3
],
j
[
4
]
,
j
[
5
]))
f
.
write
(
tplt
.
format
(
j
[
0
],
j
[
1
],
j
[
2
],
j
[
3
],
"{}
%
"
.
format
(
round
(
j
[
4
]
*
100
,
2
))
,
j
[
5
]))
f
.
write
(
sep
)
if
i
!=
top_answer_result
[
-
1
]:
f
.
write
(
header
)
...
...
@@ -216,16 +221,59 @@ def result2file():
f
.
write
(
header
)
for
i
in
top_question_result
:
for
j
in
i
:
f
.
write
(
tplt
.
format
(
j
[
0
],
j
[
1
],
j
[
2
],
j
[
3
],
j
[
4
]
,
j
[
5
]))
f
.
write
(
tplt
.
format
(
j
[
0
],
j
[
1
],
j
[
2
],
j
[
3
],
"{}
%
"
.
format
(
round
(
j
[
4
]
*
100
,
2
))
,
j
[
5
]))
f
.
write
(
sep
)
if
i
!=
top_question_result
[
-
1
]:
f
.
write
(
header
)
f
.
write
(
"
\n\n
"
)
def
rate2file
():
output_path
=
DIRECTORY_PATH
+
"rate.csv"
with
open
(
output_path
,
'a+'
)
as
f
:
line
=
get_yesterday_date
()
+
','
+
\
str
(
answer_imp_rate_all
[
3
])
+
','
+
str
(
answer_imp_rate_ios
[
3
])
+
','
+
str
(
answer_imp_rate_android
[
3
])
+
','
+
\
str
(
diary_imp_rate_all
[
3
])
+
','
+
str
(
diary_imp_rate_ios
[
3
])
+
','
+
str
(
diary_imp_rate_android
[
3
])
+
','
+
\
str
(
activate_uid_ctr_all
[
3
])
+
','
+
str
(
activate_uid_ctr_ios
[
3
])
+
','
+
str
(
activate_uid_ctr_android
[
3
])
+
','
+
\
str
(
activate_uid_imp_all
[
3
])
+
','
+
str
(
activate_uid_imp_beijing
[
3
])
+
','
+
\
str
(
click_answer_all
[
3
])
+
','
+
str
(
click_answer_ios
[
3
])
+
','
+
str
(
click_answer_android
[
3
])
+
','
+
\
str
(
click_diary_all
[
3
])
+
','
+
str
(
click_diary_ios
[
3
])
+
','
+
str
(
click_diary_android
[
3
])
+
','
+
\
str
(
click_everything_all
[
3
])
+
','
+
str
(
click_everything_ios
[
3
])
+
','
+
str
(
click_everything_android
[
3
])
+
','
+
'
\n
'
f
.
write
(
line
)
if
__name__
==
'__main__'
:
result2file
()
rate2file
()
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