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
54640cd8
Commit
54640cd8
authored
Aug 13, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in test/platform [is not null]
parent
028e45f8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
getCidRate.py
eda/test/getCidRate.py
+2
-2
getClkCidUidRate.py
eda/test/getClkCidUidRate.py
+1
-1
getTopFeatures.py
eda/test/getTopFeatures.py
+1
-1
utils.py
eda/test/utils.py
+2
-2
No files found.
eda/test/getCidRate.py
View file @
54640cd8
...
@@ -27,11 +27,11 @@ class CidRate(object):
...
@@ -27,11 +27,11 @@ class CidRate(object):
sql_cid
=
"select count(cid) from data_feed_click
\
sql_cid
=
"select count(cid) from data_feed_click
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
and device_type{1}
\
and device_type{1}
\
and cid_type='{2}'"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
0
]
==
'A
'
else
self
.
platform
,
self
.
cid_type
)
and cid_type='{2}'"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
-
2
]
==
'e
'
else
self
.
platform
,
self
.
cid_type
)
cid_clk_count
=
con_sql
(
sql_cid
)[
0
][
0
]
cid_clk_count
=
con_sql
(
sql_cid
)[
0
][
0
]
sql_all
=
"select count(cid) from data_feed_click
\
sql_all
=
"select count(cid) from data_feed_click
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
and device_type{1}"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
0
]
==
'A
'
else
self
.
platform
)
and device_type{1}"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
-
2
]
==
'e
'
else
self
.
platform
)
all_clk_count
=
con_sql
(
sql_all
)[
0
][
0
]
all_clk_count
=
con_sql
(
sql_all
)[
0
][
0
]
cid_clk_rate
=
round
(
cid_clk_count
/
all_clk_count
,
4
)
cid_clk_rate
=
round
(
cid_clk_count
/
all_clk_count
,
4
)
return
[
platform
,
cid_clk_count
,
all_clk_count
,
cid_clk_rate
]
return
[
platform
,
cid_clk_count
,
all_clk_count
,
cid_clk_rate
]
...
...
eda/test/getClkCidUidRate.py
View file @
54640cd8
...
@@ -29,7 +29,7 @@ class ClkCidUidRate(object):
...
@@ -29,7 +29,7 @@ class ClkCidUidRate(object):
sql_clk
=
"select count(distinct(device_id)) from data_feed_click
\
sql_clk
=
"select count(distinct(device_id)) from data_feed_click
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
and device_type{1}
\
and device_type{1}
\
and cid_type{2}"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
0
]
==
'A
'
else
self
.
platform
,
self
.
cid_type
)
and cid_type{2}"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
-
2
]
==
'e
'
else
self
.
platform
,
self
.
cid_type
)
clk_count
=
con_sql
(
sql_clk
)[
0
][
0
]
clk_count
=
con_sql
(
sql_clk
)[
0
][
0
]
sql_imp
=
"select count(distinct(device_id)) from data_feed_exposure
\
sql_imp
=
"select count(distinct(device_id)) from data_feed_exposure
\
...
...
eda/test/getTopFeatures.py
View file @
54640cd8
...
@@ -28,7 +28,7 @@ class TopFeatures(object):
...
@@ -28,7 +28,7 @@ class TopFeatures(object):
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
and device_type{1} and cid_type='{2}'
\
and device_type{1} and cid_type='{2}'
\
group by cid
\
group by cid
\
order by count(cid) desc"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
0
]
==
'A
'
else
self
.
platform
,
self
.
cid_type
)
order by count(cid) desc"
.
format
(
self
.
ndays
,
self
.
platform
.
replace
(
' '
,
''
)
if
self
.
platform
[
-
2
]
==
'e
'
else
self
.
platform
,
self
.
cid_type
)
clk_times
=
tuple2dict
(
con_sql
(
sql
))
clk_times
=
tuple2dict
(
con_sql
(
sql
))
return
clk_times
return
clk_times
...
...
eda/test/utils.py
View file @
54640cd8
...
@@ -52,7 +52,7 @@ def get_activate_uid_ctr(platform, ndays=1):
...
@@ -52,7 +52,7 @@ def get_activate_uid_ctr(platform, ndays=1):
platform
=
" is not null"
platform
=
" is not null"
sql_clk
=
"select count(device_id) from data_feed_click
\
sql_clk
=
"select count(device_id) from data_feed_click
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
and device_type{1}"
.
format
(
ndays
,
platform
.
replace
(
' '
,
''
)
if
platform
[
0
]
==
'A
'
else
platform
)
and device_type{1}"
.
format
(
ndays
,
platform
.
replace
(
' '
,
''
)
if
platform
[
-
2
]
==
'e
'
else
platform
)
clk_count
=
con_sql
(
sql_clk
)[
0
][
0
]
clk_count
=
con_sql
(
sql_clk
)[
0
][
0
]
sql_imp
=
"select count(device_id) from data_feed_exposure
\
sql_imp
=
"select count(device_id) from data_feed_exposure
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{0} day)
\
...
@@ -60,7 +60,7 @@ def get_activate_uid_ctr(platform, ndays=1):
...
@@ -60,7 +60,7 @@ def get_activate_uid_ctr(platform, ndays=1):
(select device_id from data_feed_click
\
(select device_id from data_feed_click
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{1} day)
\
where from_unixtime(time,'
%
Y-
%
m-
%
d')=date_add(curdate(), interval -{1} day)
\
and device_type{2})
\
and device_type{2})
\
and device_type{3}"
.
format
(
ndays
,
ndays
,
platform
.
replace
(
' '
,
''
)
if
platform
[
0
]
==
'A
'
else
platform
,
platform
)
and device_type{3}"
.
format
(
ndays
,
ndays
,
platform
.
replace
(
' '
,
''
)
if
platform
[
-
2
]
==
'e
'
else
platform
,
platform
)
imp_count
=
con_sql
(
sql_imp
)[
0
][
0
]
imp_count
=
con_sql
(
sql_imp
)[
0
][
0
]
clk_rate
=
round
(
clk_count
/
imp_count
,
4
)
clk_rate
=
round
(
clk_count
/
imp_count
,
4
)
if
platform
==
"='App Store'"
:
if
platform
==
"='App Store'"
:
...
...
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