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
8ced0dee
Commit
8ced0dee
authored
Aug 10, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
pretty output
parents
bedd1349
1fe5b11d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
predictDiary.py
predictDiary.py
+13
-13
readme.txt
readme.txt
+1
-0
utils.py
utils.py
+2
-3
No files found.
predictDiary.py
View file @
8ced0dee
...
...
@@ -93,17 +93,17 @@ def router(device_id):
if
__name__
==
"__main__"
:
# TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同
router
(
'358035085192742'
)
#
while True:
#
start = time.time()
#
empty,device_id_list = get_active_users()
#
if empty:
#
time.sleep(10)
#
else:
#
for device_id in device_id_list:
#
router(device_id)
#
#
end = time.time()
#
time_cost = (end - start)
#
print("预测耗时{}秒".format(time_cost))
while
True
:
start
=
time
.
time
()
empty
,
device_id_list
=
get_active_users
()
if
empty
:
time
.
sleep
(
10
)
else
:
for
device_id
in
device_id_list
:
router
(
device_id
)
end
=
time
.
time
()
time_cost
=
(
end
-
start
)
print
(
"预测耗时{}秒"
.
format
(
time_cost
))
readme.txt
View file @
8ced0dee
...
...
@@ -11,6 +11,7 @@ cd xlearn
./build.sh
(3) 在nvwa中安装相关工具包:
pip install pymysql
pip install redis
pip install numpy
sudo apt-get install python3-dev
pip install pandas
...
...
utils.py
View file @
8ced0dee
...
...
@@ -19,9 +19,8 @@ def con_sql(sql):
def
add_data_to_redis
(
key
,
val
):
r
=
redis
.
StrictRedis
(
host
=
'10.30.50.58'
,
port
=
6379
,
db
=
12
)
r
.
set
(
key
,
val
)
# 设置key的过期时间
r
.
expire
(
key
,
36
*
60
)
# 设置key的过期时间,36小时后过期
r
.
expire
(
key
,
36
*
60
*
60
)
# ffm 格式转换函数、类
class
FFMFormatPandas
:
...
...
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