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
399e04ee
Commit
399e04ee
authored
Aug 16, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a foo to transform tuple2
parent
021a4e92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
getClickZeroUidRateDetail.py
eda/recommended_indexs/getClickZeroUidRateDetail.py
+15
-4
getRate.py
eda/recommended_indexs/getRate.py
+6
-6
No files found.
eda/recommended_indexs/getClickZeroUidRateDetail.py
View file @
399e04ee
...
...
@@ -128,11 +128,22 @@ def get_rate_detail(platform):
db
.
close
()
return
result
def
result2dict
(
result
):
"""
result : tuple2
rtype : dict
"""
dct
=
{}
sum_count
=
0
for
i
in
result
:
sum_count
+=
i
[
1
]
for
i
in
result
:
dct
[
i
[
0
]]
=
"{}
%
"
.
format
(
round
(
i
[
1
]
/
sum_count
*
100
,
2
))
return
dct
no_click_uid_detail_all
=
get_rate_detail
(
"all"
)
no_click_uid_detail_ios
=
get_rate_detail
(
"ios"
)
no_click_uid_detail_android
=
get_rate_detail
(
"android"
)
no_click_uid_detail_all
=
result2dict
(
get_rate_detail
(
"all"
))
no_click_uid_detail_ios
=
result2dict
(
get_rate_detail
(
"ios"
))
no_click_uid_detail_android
=
result2dict
(
get_rate_detail
(
"android"
))
...
...
eda/recommended_indexs/getRate.py
View file @
399e04ee
...
...
@@ -48,7 +48,7 @@ def result2file(fpath):
android_answer_imp_rate
=
get_android_answer_imp_rate
()
lst
=
[
all_answer_imp_rate
,
ios_answer_imp_rate
,
android_answer_imp_rate
]
for
i
in
lst
:
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
i
[
3
]
*
100
))
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
round
(
i
[
3
]
*
100
,
2
)
))
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.1已将answer曝光占比存入文件"
)
...
...
@@ -60,7 +60,7 @@ def result2file(fpath):
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
],
"{}
%
"
.
format
(
i
[
3
]
*
100
))
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
round
(
i
[
3
]
*
100
,
2
)
))
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.2已将diary曝光占比存入文件"
)
...
...
@@ -72,7 +72,7 @@ def result2file(fpath):
android_click_one_rate
=
get_android_click_one_rate
()
lst
=
[
all_click_one_rate
,
ios_click_one_rate
,
android_click_one_rate
]
for
i
in
lst
:
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
i
[
3
]
*
100
))
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
round
(
i
[
3
]
*
100
,
2
)
))
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.3已将活跃用户点击率存入文件"
)
...
...
@@ -84,7 +84,7 @@ def result2file(fpath):
android_click_answer_rate
=
get_android_click_answer_rate
()
lst
=
[
all_click_answer_rate
,
ios_click_answer_rate
,
android_click_answer_rate
]
for
i
in
lst
:
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
i
[
3
]
*
100
))
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
round
(
i
[
3
]
*
100
,
2
)
))
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.5已将点击answer用户占比存入文件"
)
...
...
@@ -96,7 +96,7 @@ def result2file(fpath):
android_click_diary_rate
=
get_android_click_diary_rate
()
lst
=
[
all_click_diary_rate
,
ios_click_diary_rate
,
android_click_diary_rate
]
for
i
in
lst
:
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
i
[
3
]
*
100
))
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
round
(
i
[
3
]
*
100
,
2
)
))
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.6已将点击diary用户占比存入文件"
)
...
...
@@ -108,7 +108,7 @@ def result2file(fpath):
android_click_zero_rate
=
get_android_click_zero_rate
()
lst
=
[
all_click_zero_rate
,
ios_click_zero_rate
,
android_click_zero_rate
]
for
i
in
lst
:
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
i
[
3
]
*
100
))
line
=
tplt
.
format
(
i
[
0
],
i
[
1
],
i
[
2
],
"{}
%
"
.
format
(
round
(
i
[
3
]
*
100
,
2
)
))
f
.
write
(
line
)
f
.
write
(
'
\n
'
)
print
(
"1.7已将无点击用户占比存入文件"
)
...
...
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