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
5b39ddf3
Commit
5b39ddf3
authored
Aug 22, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print
parent
3242889e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
16 deletions
+7
-16
diaryQueueUpdate.py
diaryQueueUpdate.py
+6
-16
diaryQueue.py
local/diaryQueue.py
+1
-0
No files found.
diaryQueueUpdate.py
View file @
5b39ddf3
...
...
@@ -120,7 +120,9 @@ def save_result(queue_name, x_list):
score_df
=
pd
.
read_csv
(
DIRECTORY_PATH
+
"result/output{0}_{1}.csv"
.
format
(
device_id
,
queue_name
),
header
=
None
)
score_df
=
score_df
.
rename
(
columns
=
{
0
:
"score"
})
score_df
[
"cid"
]
=
x_list
print
(
"done save_reult"
)
score_df
=
score_df
.
sort_values
(
by
=
"score"
,
ascending
=
False
)
print
(
"概率前十行:"
)
print
(
score_df
.
head
(
10
))
return
score_df
...
...
@@ -136,21 +138,9 @@ def merge_score(x_list, score_df):
sql
=
"select score from biz_feed_diary_score where diary_id in {};"
.
format
(
x_list
)
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
print
(
"获取成功"
)
score_list
=
pd
.
DataFrame
(
list
(
result
))[
0
]
.
values
.
tolist
()
#score_list = []
# for i in x_list:
# sql = "select score from biz_feed_diary_score where diary_id = '{}';".format(i)
# cursor.execute(sql)
# if cursor.execute(sql) != 0:
# result = cursor.fetchone()[0]
# score_list.append(result)
# print("成功获取")
# # 没有查到这个diary_id,默认score值是0
# else:
# print("结果是空")
# score_list.append(0)
score_df
=
pd
.
DataFrame
(
list
(
result
))
print
(
"数据库日记表前十行"
)
score_list
=
score_df
[
0
]
.
values
.
tolist
()
db
.
close
()
...
...
local/diaryQueue.py
View file @
5b39ddf3
...
...
@@ -103,6 +103,7 @@ def save_result(queue_name, x_list):
score_df
=
pd
.
read_csv
(
"/Users/mac/utils/result/{0}_output.txt"
.
format
(
queue_name
),
header
=
None
)
score_df
=
score_df
.
rename
(
columns
=
{
0
:
"score"
})
score_df
[
"cid"
]
=
x_list
score_df
=
score_df
.
sort_values
(
by
=
"score"
,
ascending
=
False
)
merge_score
(
x_list
,
score_df
)
...
...
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