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
f25887eb
Commit
f25887eb
authored
Aug 10, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function save dataset_device_id,change main for train
parent
413961fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
predictDiary.py
predictDiary.py
+12
-13
processData.py
processData.py
+7
-0
train.py
train.py
+3
-2
No files found.
predictDiary.py
View file @
f25887eb
...
...
@@ -94,17 +94,16 @@ def router(device_id):
if
__name__
==
"__main__"
:
# TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同
router
(
"00BBE073-ACE3-4588-9ED8-B35F13D282EB"
)
# 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
))
processData.py
View file @
f25887eb
...
...
@@ -60,6 +60,13 @@ def feature_en():
print
(
cid_df
.
head
(
2
))
cid_df
.
to_csv
(
DIRECTORY_PATH
+
"data_set_cid.csv"
,
index
=
False
)
# 将device_id 保存。目的是为了判断预测的device_id是否在这个集合里,如果不在,不需要预测
data_set_device_id
=
data
[
"device_id"
]
.
unique
()
device_id_df
=
pd
.
DataFrame
()
device_id_df
[
'device_id'
]
=
data_set_device_id
print
(
"data_set_device_id :"
)
print
(
device_id_df
.
head
(
2
))
device_id_df
.
to_csv
(
DIRECTORY_PATH
+
"device_id.csv"
,
index
=
False
)
return
data
,
test_number
,
validation_number
...
...
train.py
View file @
f25887eb
...
...
@@ -8,6 +8,7 @@ if __name__ == "__main__":
data_fe
=
feature_en
()
ffm_transform
(
data_fe
)
train
()
print
(
'---------------prepare candidates--------------'
)
get_eachCityDiaryTop3000
()
print
(
"end"
)
# print('---------------prepare candidates--------------')
# get_eachCityDiaryTop3000()
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