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
2dfcb8c0
Commit
2dfcb8c0
authored
Oct 19, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改统计指标
parent
ecc4459a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
15 deletions
+6
-15
ctr-56.py
ctr-56.py
+5
-15
test_supervisor.py
local/test_supervisor.py
+1
-0
No files found.
ctr-56.py
View file @
2dfcb8c0
...
@@ -34,23 +34,13 @@ def ctr_all():
...
@@ -34,23 +34,13 @@ def ctr_all():
result
=
cursor
.
fetchall
()
result
=
cursor
.
fetchall
()
tail56
=
pd
.
DataFrame
(
list
(
result
))[
0
]
.
values
.
tolist
()
tail56
=
pd
.
DataFrame
(
list
(
result
))[
0
]
.
values
.
tolist
()
start
=
"2018-09-05"
print
(
"当天尾号5或6活跃用户总数:"
)
sql_all
=
"select distinct device_id from data_feed_click "
\
print
(
len
(
tail56
))
"where stat_date >= '{}' and stat_date <= '{}' and cid_type = 'diary'"
.
format
(
start
,
date
)
cursor
.
execute
(
sql_all
)
result_all
=
cursor
.
fetchall
()
df
=
pd
.
DataFrame
(
list
(
result_all
))
all_user
=
df
[
0
]
.
values
.
tolist
()
print
(
"老用户总数:"
)
print
(
len
(
all_user
))
day_all
=
set
(
all_user
)
&
set
(
tail56
)
print
(
"当天老用户总数:"
)
print
(
len
(
day_all
))
cover
=
len
(
day_all
&
set
(
device_id
))
cover
=
len
(
set
(
tail56
)
&
set
(
device_id
))
print
(
"当天尾号5或6活跃用户覆盖数:"
)
print
(
"当天尾号5或6活跃用户覆盖数:"
)
print
(
cover
)
print
(
cover
)
cover_percent
=
format
(
cover
/
len
(
day_all
),
".3f"
)
cover_percent
=
format
(
cover
/
len
(
tail56
),
".3f"
)
print
(
"当天尾号5或6活跃用户覆盖率:"
)
print
(
"当天尾号5或6活跃用户覆盖率:"
)
print
(
cover_percent
)
print
(
cover_percent
)
sql_click
=
"select count(cid) from data_feed_click "
\
sql_click
=
"select count(cid) from data_feed_click "
\
...
@@ -66,7 +56,7 @@ def ctr_all():
...
@@ -66,7 +56,7 @@ def ctr_all():
exp
=
cursor
.
fetchone
()[
0
]
exp
=
cursor
.
fetchone
()[
0
]
print
(
"曝光数:"
+
str
(
exp
))
print
(
"曝光数:"
+
str
(
exp
))
print
(
"点击率:"
+
str
(
click
/
exp
))
print
(
"点击率:"
+
str
(
click
/
exp
))
return
len
(
day_all
),
cover
,
cover_percent
,
click
,
exp
,
format
(
click
/
exp
,
".6f"
)
return
len
(
tail56
),
cover
,
cover_percent
,
click
,
exp
,
format
(
click
/
exp
,
".6f"
)
def
ctr
():
def
ctr
():
...
...
local/test_supervisor.py
View file @
2dfcb8c0
...
@@ -196,6 +196,7 @@ def router(device_id):
...
@@ -196,6 +196,7 @@ def router(device_id):
predict
(
user_profile
)
predict
(
user_profile
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
sql
=
"delete from data_feed_click where stat_date = '2018-10-17'"
while
True
:
while
True
:
start
=
time
.
time
()
start
=
time
.
time
()
empty
,
device_id_list
=
get_active_users
()
empty
,
device_id_list
=
get_active_users
()
...
...
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