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
1fe5b11d
Commit
1fe5b11d
authored
Aug 10, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change main function for test
parent
7ddb9cdc
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 @
1fe5b11d
...
@@ -93,17 +93,17 @@ def router(device_id):
...
@@ -93,17 +93,17 @@ def router(device_id):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同
# TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同
router
(
'358035085192742'
)
#
while True:
while
True
:
#
start = time.time()
start
=
time
.
time
()
#
empty,device_id_list = get_active_users()
empty
,
device_id_list
=
get_active_users
()
#
if empty:
if
empty
:
#
time.sleep(10)
time
.
sleep
(
10
)
#
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
)
#
print("预测耗时{}秒".format(time_cost))
print
(
"预测耗时{}秒"
.
format
(
time_cost
))
readme.txt
View file @
1fe5b11d
...
@@ -11,6 +11,7 @@ cd xlearn
...
@@ -11,6 +11,7 @@ cd xlearn
./build.sh
./build.sh
(3) 在nvwa中安装相关工具包:
(3) 在nvwa中安装相关工具包:
pip install pymysql
pip install pymysql
pip install redis
pip install numpy
pip install numpy
sudo apt-get install python3-dev
sudo apt-get install python3-dev
pip install pandas
pip install pandas
...
...
utils.py
View file @
1fe5b11d
...
@@ -19,9 +19,8 @@ def con_sql(sql):
...
@@ -19,9 +19,8 @@ def con_sql(sql):
def
add_data_to_redis
(
key
,
val
):
def
add_data_to_redis
(
key
,
val
):
r
=
redis
.
StrictRedis
(
host
=
'10.30.50.58'
,
port
=
6379
,
db
=
12
)
r
=
redis
.
StrictRedis
(
host
=
'10.30.50.58'
,
port
=
6379
,
db
=
12
)
r
.
set
(
key
,
val
)
r
.
set
(
key
,
val
)
# 设置key的过期时间
# 设置key的过期时间,36小时后过期
r
.
expire
(
key
,
36
*
60
)
r
.
expire
(
key
,
36
*
60
*
60
)
# ffm 格式转换函数、类
# ffm 格式转换函数、类
class
FFMFormatPandas
:
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