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
c3106702
Commit
c3106702
authored
Aug 09, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
add print
parents
94a4223f
7e9d63c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
getTopFeatures.py
eda/test/getTopFeatures.py
+4
-4
No files found.
eda/test/getTopFeatures.py
View file @
c3106702
...
...
@@ -61,7 +61,7 @@ class TopFeatures(object):
url
=
"http://m.igengmei.com/diary_book/"
+
i
[
i
.
index
(
'|'
)
+
1
:]
+
'/'
else
:
url
=
"http://m.igengmei.com/{0}/"
.
format
(
self
.
cid_type
)
+
i
[
i
.
index
(
'|'
)
+
1
:]
+
'/'
topn
.
append
((
self
.
cid_type
.
strip
(),
i
,
clk
[
i
],
0
,
0
,
url
))
topn
.
append
((
self
.
platform
.
strip
(),
i
,
clk
[
i
],
0
,
0
,
url
))
topn
.
sort
(
key
=
lambda
x
:
x
[
2
],
reverse
=
True
)
return
topn
[:
int
(
self
.
top_n
)]
#获取topN的曝光
...
...
@@ -71,7 +71,7 @@ class TopFeatures(object):
url
=
"http://m.igengmei.com/diary_book/"
+
i
[
i
.
index
(
'|'
)
+
1
:]
+
'/'
else
:
url
=
"http://m.igengmei.com/{0}/"
.
format
(
self
.
cid_type
)
+
i
[
i
.
index
(
'|'
)
+
1
:]
+
'/'
topn
.
append
((
self
.
cid_type
.
strip
(),
i
,
0
,
imp
[
i
],
0
,
url
))
topn
.
append
((
self
.
platform
.
strip
(),
i
,
0
,
imp
[
i
],
0
,
url
))
topn
.
sort
(
key
=
lambda
x
:
x
[
3
],
reverse
=
True
)
return
topn
[:
int
(
self
.
top_n
)]
#获取topN的ctr
...
...
@@ -82,7 +82,7 @@ class TopFeatures(object):
url
=
"http://m.igengmei.com/diary_book/"
+
i
[
i
.
index
(
'|'
)
+
1
:]
+
'/'
else
:
url
=
"http://m.igengmei.com/{0}/"
.
format
(
self
.
cid_type
)
+
i
[
i
.
index
(
'|'
)
+
1
:]
+
'/'
topn
.
append
((
self
.
cid_type
.
strip
(),
i
,
clk
[
i
],
imp
[
i
],
round
(
clk
[
i
]
/
imp
[
i
],
4
),
url
))
topn
.
append
((
self
.
platform
.
strip
(),
i
,
clk
[
i
],
imp
[
i
],
round
(
clk
[
i
]
/
imp
[
i
],
4
),
url
))
topn
.
sort
(
key
=
lambda
x
:
x
[
4
],
reverse
=
True
)
return
topn
[:
int
(
self
.
top_n
)]
...
...
@@ -125,7 +125,7 @@ def main():
clk_diary_ctr_android
=
top_diary
.
get_result
(
clk_diary_times_android
,
imp_diary_times_android
,
4
,
"ctr"
)
result_lst
=
[
clk_diary_ctr_all
,
clk_diary_ctr_ios
,
clk_diary_ctr_android
]
output_path
=
DIRECTORY_PATH
+
"5top100_ctr_diary_
%
s.txt"
output_path
=
DIRECTORY_PATH
+
"5top100_ctr_diary_
%
s.txt"
.
format
(
get_yesterday_date
())
top_diary
.
result2file
(
result_lst
,
output_path
)
...
...
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