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
eaf728d4
Commit
eaf728d4
authored
Aug 09, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
fix bug in eda/test/getTopFeatures.py with a positional args
parents
36261559
e598c182
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
predictDiary.py
predictDiary.py
+2
-4
userProfile.py
userProfile.py
+1
-1
No files found.
predictDiary.py
View file @
eaf728d4
...
@@ -94,14 +94,12 @@ if __name__ == "__main__":
...
@@ -94,14 +94,12 @@ if __name__ == "__main__":
start
=
time
.
time
()
start
=
time
.
time
()
empty
,
device_id_list
=
get_active_users
()
empty
,
device_id_list
=
get_active_users
()
if
empty
:
if
empty
:
print
(
"当前没有活跃用户,不需要预测"
)
time
.
sleep
(
60
)
time
.
sleep
(
60
)
else
:
else
:
for
device_id
in
device_id_list
:
for
device_id
in
device_id_list
:
router
(
device_id
)
router
(
device_id
)
end
=
time
.
time
()
end
=
time
.
time
()
# 将秒转化为毫秒
time_cost
=
(
end
-
start
)
time_cost
=
(
end
-
start
)
*
1000
print
(
"预测耗时{}秒"
.
format
(
time_cost
))
print
(
"预测耗时{}毫秒"
.
format
(
time_cost
))
userProfile.py
View file @
eaf728d4
...
@@ -11,7 +11,7 @@ def get_active_users():
...
@@ -11,7 +11,7 @@ def get_active_users():
"where active_time <= '{}' and active_time >= '{}'"
.
format
(
now_end
,
now_start
)
"where active_time <= '{}' and active_time >= '{}'"
.
format
(
now_end
,
now_start
)
device_id_df
=
con_sql
(
sql
)
device_id_df
=
con_sql
(
sql
)
if
device_id_df
.
empty
:
if
device_id_df
.
empty
:
print
(
"当下这一分钟没有活跃用户"
)
print
(
"当下这一分钟没有活跃用户
,不需要预测
"
)
return
True
,
None
return
True
,
None
else
:
else
:
device_id_list
=
device_id_df
[
0
]
.
values
.
tolist
()
device_id_list
=
device_id_df
[
0
]
.
values
.
tolist
()
...
...
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