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
50f01f00
Commit
50f01f00
authored
Aug 22, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print
parent
dfdcb07f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
diaryQueueUpdate.py
diaryQueueUpdate.py
+8
-4
No files found.
diaryQueueUpdate.py
View file @
50f01f00
...
...
@@ -112,7 +112,7 @@ def predict(queue_name, x_list):
ffm_model
.
predict
(
DIRECTORY_PATH
+
"model.out"
,
DIRECTORY_PATH
+
"result/output{0}_{1}.csv"
.
format
(
device_id
,
queue_name
))
print
(
"done predict"
)
save_result
(
queue_name
,
x_list
)
...
...
@@ -121,7 +121,8 @@ def save_result(queue_name, x_list):
score_df
=
score_df
.
rename
(
columns
=
{
0
:
"score"
})
score_df
[
"cid"
]
=
x_list
print
(
"done save_reult"
)
merge_score
(
x_list
,
score_df
)
return
score_df
def
merge_score
(
x_list
,
score_df
):
...
...
@@ -154,8 +155,8 @@ def merge_score(x_list, score_df):
db
.
close
()
score_df
[
"score"
]
=
score_df
[
"score"
]
+
score_list
return
score_df
update_dairy_queue
(
score_df
)
def
update_dairy_queue
(
score_df
):
...
...
@@ -202,7 +203,10 @@ def update_sql_dairy_queue(queue_name, diary_id):
def
multi_update
(
key
,
name_dict
):
diary_id
=
predict
(
key
,
name_dict
[
key
])
predict
(
key
,
name_dict
[
key
])
score_df
=
save_result
(
key
,
name_dict
[
key
])
score_df
=
merge_score
(
name_dict
[
key
],
score_df
)
diary_id
=
update_dairy_queue
(
score_df
)
if
get_native_queue
(
device_id
)
==
native_queue_list
:
update_sql_dairy_queue
(
key
,
diary_id
)
...
...
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