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
51d226f9
Commit
51d226f9
authored
Aug 15, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add delete temp log
parent
9faccb11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
delete_temp_files.py
delete_temp_files.py
+0
-7
predictDiary.py
predictDiary.py
+5
-1
No files found.
delete_temp_files.py
View file @
51d226f9
...
...
@@ -17,15 +17,8 @@ def remove_files(fileDir):
os
.
remove
(
fileDir
+
"/"
+
eachFile
)
def
remove_tmp
():
for
eachFile
in
os
.
listdir
(
"/tmp"
):
if
"xlearn"
in
eachFile
:
os
.
remove
(
"/tmp"
+
"/"
+
eachFile
)
if
__name__
==
"__main__"
:
while
True
:
remove_tmp
()
remove_files
(
DIRECTORY_PATH
+
"result"
)
print
(
"运行一次"
)
time
.
sleep
(
5
*
60
)
predictDiary.py
View file @
51d226f9
...
...
@@ -5,6 +5,7 @@ import xlearn as xl
from
userProfile
import
*
import
time
from
utils
import
*
import
os
# 将device_id、city_id拼接到对应的城市热门日记表。注意:下面预测集特征顺序要与训练集保持一致
...
...
@@ -93,7 +94,10 @@ if __name__ == "__main__":
while
True
:
empty
,
device_id_list
=
get_active_users
()
if
empty
:
time
.
sleep
(
60
)
for
eachFile
in
os
.
listdir
(
"/tmp"
):
if
"xlearn"
in
eachFile
:
os
.
remove
(
"/tmp"
+
"/"
+
eachFile
)
time
.
sleep
(
58
)
else
:
old_device_id_list
=
pd
.
read_csv
(
DIRECTORY_PATH
+
"data_set_device_id.csv"
)[
"device_id"
]
.
values
.
tolist
()
for
device_id
in
device_id_list
:
...
...
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