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
491fa8ee
Commit
491fa8ee
authored
Oct 10, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加画像更新的统计日志
parent
dfd16540
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
evaluation_metrics.py
eda/smart_rank/evaluation_metrics.py
+19
-1
No files found.
eda/smart_rank/evaluation_metrics.py
View file @
491fa8ee
...
...
@@ -187,7 +187,23 @@ if __name__ == '__main__':
cmd_coincide_n
=
int
(
sys
.
argv
[
2
])
result
=
get_2_tags_coincide_rate
(
all_device_order_tags2
,
all_device_portrait_result
,
cmd_portrait_top_n
,
cmd_coincide_n
)
print
(
"统计日期:"
,
my_yesterday
)
# 统计画像更新的耗时和更新的设备数
sql
=
"select count(*) from user_service_portrait_tags where stat_date='{my_today}'"
.
format
(
my_today
=
my_today
)
portrait_device_count
=
get_data_by_mysql
(
'172.16.40.158'
,
4000
,
'root'
,
'3SYz54LS9#^9sBvC'
,
'jerry_test'
,
sql
)
with
open
(
"/home/gmuser/gyz/log/dist_portrait.log"
,
'r'
)
as
f
:
lines
=
f
.
readlines
()
start_datetime_str
=
lines
[
0
][:
19
]
end_datetime_str
=
lines
[
-
1
][:
19
]
start_datetime
=
datetime
.
datetime
.
strptime
(
start_datetime_str
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
end_datetime
=
datetime
.
datetime
.
strptime
(
end_datetime_str
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
time_consuming
=
(
end_datetime
-
start_datetime
)
.
seconds
/
60
print
(
"画像更新统计日期:"
,
my_today
)
print
(
"画像更新耗时:{time_consuming}分钟"
.
format
(
time_consuming
=
time_consuming
))
print
(
"画像更新的设备数:"
,
portrait_device_count
[
0
][
"count(*)"
])
print
(
"-"
*
66
)
print
(
"画像匹配度统计日期:"
,
my_yesterday
)
print
(
"画像的前n个tag:"
,
cmd_portrait_top_n
)
print
(
"重合个数:"
,
cmd_coincide_n
)
print
(
"下单人数:"
,
result
[
"device_count"
])
...
...
@@ -195,5 +211,6 @@ if __name__ == '__main__':
print
(
"匹配度:"
,
result
[
"coincide_rate"
])
print
(
"比对不上的有画像的人数:"
,
result
[
"not_coincide_have_portrait_count"
])
print
(
"比对不上的无画像的人数:"
,
result
[
"not_coincide_no_portrait_count"
])
print
(
"="
*
100
)
except
Exception
as
e
:
print
(
e
)
\ No newline at end of file
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