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
09c6c9a1
Commit
09c6c9a1
authored
Oct 30, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ce335162
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
dist_update_user_portrait_service.py
eda/smart_rank/dist_update_user_portrait_service.py
+3
-0
tool.py
eda/smart_rank/tool.py
+2
-0
No files found.
eda/smart_rank/dist_update_user_portrait_service.py
View file @
09c6c9a1
...
@@ -115,6 +115,8 @@ def get_user_service_portrait(cl_id, all_word_tags, all_tag_tag_type, all_3tag_2
...
@@ -115,6 +115,8 @@ def get_user_service_portrait(cl_id, all_word_tags, all_tag_tag_type, all_3tag_2
.
format
(
stat_date
=
stat_date
,
cl_id
=
cl_id
,
tag_list
=
gmkv_tag_score_sum
)
.
format
(
stat_date
=
stat_date
,
cl_id
=
cl_id
,
tag_list
=
gmkv_tag_score_sum
)
cur_jerry_test
.
execute
(
replace_sql
)
cur_jerry_test
.
execute
(
replace_sql
)
db_jerry_test
.
commit
()
db_jerry_test
.
commit
()
cur_jerry_test
.
close
()
db_jerry_test
.
close
()
# # 写tidb 用户分层营销
# # 写tidb 用户分层营销
# # todo 不准确,因为聚合后,一个标签会有多个来源,即多个pay_type
# # todo 不准确,因为聚合后,一个标签会有多个来源,即多个pay_type
# score_result = tag_score_sum[["tag2", "cl_id", "tag_score", "weight", "pay_type"]]
# score_result = tag_score_sum[["tag2", "cl_id", "tag_score", "weight", "pay_type"]]
...
@@ -146,6 +148,7 @@ if __name__ == '__main__':
...
@@ -146,6 +148,7 @@ if __name__ == '__main__':
cur_jerry_test
.
execute
(
sql_device_ids
)
cur_jerry_test
.
execute
(
sql_device_ids
)
device_ids_lst
=
[
i
[
0
]
for
i
in
cur_jerry_test
.
fetchall
()]
device_ids_lst
=
[
i
[
0
]
for
i
in
cur_jerry_test
.
fetchall
()]
db_jerry_test
.
close
()
db_jerry_test
.
close
()
cur_jerry_test
.
close
()
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:ReDis!GmTx*0aN9@172.16.40.173:6379'
)
redis_client
=
redis
.
StrictRedis
.
from_url
(
'redis://:ReDis!GmTx*0aN9@172.16.40.173:6379'
)
# 获取搜索词及其近义词对应的tag
# 获取搜索词及其近义词对应的tag
...
...
eda/smart_rank/tool.py
View file @
09c6c9a1
...
@@ -55,6 +55,7 @@ def get_data_by_mysql(host, port, user, passwd, db, sql):
...
@@ -55,6 +55,7 @@ def get_data_by_mysql(host, port, user, passwd, db, sql):
cursor
.
execute
(
sql
)
cursor
.
execute
(
sql
)
results
=
cursor
.
fetchall
()
results
=
cursor
.
fetchall
()
db
.
close
()
db
.
close
()
cursor
.
close
()
return
results
return
results
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
...
@@ -67,6 +68,7 @@ def write_data_by_mysql(host, port, user, passwd, db, sql):
...
@@ -67,6 +68,7 @@ def write_data_by_mysql(host, port, user, passwd, db, sql):
cursor
.
execute
(
sql
)
cursor
.
execute
(
sql
)
db
.
commit
()
db
.
commit
()
db
.
close
()
db
.
close
()
cursor
.
close
()
return
True
return
True
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
...
...
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