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
36261559
Commit
36261559
authored
Aug 09, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in eda/test/getTopFeatures.py with positional args
parent
6a65f4ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
getTopFeatures.py
eda/test/getTopFeatures.py
+6
-6
No files found.
eda/test/getTopFeatures.py
View file @
36261559
...
...
@@ -45,12 +45,12 @@ class TopFeatures(object):
imp_times
=
tuple2dict
(
con_sql
(
sql
))
return
imp_times
def
get_result
(
self
,
clk
,
imp
,
clk_n
=
2
,
result_types
=
"ctr"
):
def
get_result
(
self
,
clk
=
{},
imp
=
{}
,
clk_n
=
2
,
result_types
=
"ctr"
):
"""
result_types : "clk";"imp";"ctr"
clk : dict
imp : dict
clk_n : 获取topN点击率时,过滤的点击数
result_types : "clk";"imp";"ctr"
rtype : list
"""
topn
=
[]
...
...
@@ -111,18 +111,18 @@ class TopFeatures(object):
def
main
():
top_diary
=
TopFeatures
(
1
,
"all"
,
"diary"
)
top_diary
=
TopFeatures
(
1
,
"all"
,
"diary"
,
100
)
clk_diary_times_all
=
top_diary
.
get_click_times
()
imp_diary_times_all
=
top_diary
.
get_impression_times
()
clk_diary_ctr_all
=
top_diary
.
get_result
(
"ctr"
,
clk_diary_times_all
,
imp_diary_times_all
,
top_n
=
100
)
clk_diary_ctr_all
=
top_diary
.
get_result
(
clk_diary_times_all
,
imp_diary_times_all
,
4
,
"ctr"
)
clk_diary_times_ios
=
top_diary
.
get_click_times
()
imp_diary_times_ios
=
top_diary
.
get_impression_times
()
clk_diary_ctr_ios
=
top_diary
.
get_result
(
"ctr"
,
clk_diary_times_ios
,
imp_diary_times_ios
,
top_n
=
100
)
clk_diary_ctr_ios
=
top_diary
.
get_result
(
clk_diary_times_ios
,
imp_diary_times_ios
,
4
,
"ctr"
)
clk_diary_times_android
=
top_diary
.
get_click_times
()
imp_diary_times_android
=
top_diary
.
get_impression_times
()
clk_diary_ctr_android
=
top_diary
.
get_result
(
"ctr"
,
clk_diary_times_android
,
imp_diary_times_android
,
top_n
=
100
)
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"
...
...
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