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
2490db6d
Commit
2490db6d
authored
May 21, 2020
by
任婷婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
65fe9999
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
tag3_update_user_portrait_offline.py
eda/smart_rank/tag3_update_user_portrait_offline.py
+5
-5
test_divided_portrait.py
eda/smart_rank/test_divided_portrait.py
+1
-0
tool.py
eda/smart_rank/tool.py
+4
-4
No files found.
eda/smart_rank/tag3_update_user_portrait_offline.py
View file @
2490db6d
...
@@ -95,11 +95,11 @@ def update_tag3_user_portrait(cl_id):
...
@@ -95,11 +95,11 @@ def update_tag3_user_portrait(cl_id):
# }
# }
# redis_client.set(key2, json.dumps(res2))
# redis_client.set(key2, json.dumps(res2))
# redis_client.expire(key2, 60 * 60 * 24 * 30)
# redis_client.expire(key2, 60 * 60 * 24 * 30)
# print('*'*10)
write_user_portrait
(
cl_id
,
","
.
join
(
first_solutions_score
.
keys
()),
","
.
join
(
second_solutions_score
.
keys
()),
#
write_user_portrait(cl_id, ",".join(first_solutions_score.keys()), ",".join(second_solutions_score.keys()),
","
.
join
(
first_demands_score
.
keys
()),
","
.
join
(
second_demands_score
.
keys
()),
#
",".join(first_demands_score.keys()), ",".join(second_demands_score.keys()),
","
.
join
(
first_positions_score
.
keys
()),
","
.
join
(
second_positions_score
.
keys
()),
#
",".join(first_positions_score.keys()), ",".join(second_positions_score.keys()),
","
.
join
(
projects_score
.
keys
()))
#
",".join(projects_score.keys()))
first_solutions
=
[]
first_solutions
=
[]
first_positions
=
[]
first_positions
=
[]
...
...
eda/smart_rank/test_divided_portrait.py
View file @
2490db6d
...
@@ -17,6 +17,7 @@ def get_user_portrait_log(cl_id):
...
@@ -17,6 +17,7 @@ def get_user_portrait_log(cl_id):
sql
=
"""select cl_id,event_cn, first_solutions, second_solutions, first_demands,
sql
=
"""select cl_id,event_cn, first_solutions, second_solutions, first_demands,
second_demands, first_positions, second_positions, projects
second_demands, first_positions, second_positions, projects
from kafka_tag3_log where cl_id in {} """
.
format
(
tuple
(
cl_id
))
from kafka_tag3_log where cl_id in {} """
.
format
(
tuple
(
cl_id
))
print
(
'&'
*
100
)
print
(
"sql"
,
sql
)
print
(
"sql"
,
sql
)
db
,
cursor
=
get_jerry_test
()
db
,
cursor
=
get_jerry_test
()
cursor
.
execute
(
sql
)
cursor
.
execute
(
sql
)
...
...
eda/smart_rank/tool.py
View file @
2490db6d
...
@@ -443,7 +443,7 @@ def write_user_portrait(cl_id, first_solutions, second_solutions, first_demands,
...
@@ -443,7 +443,7 @@ def write_user_portrait(cl_id, first_solutions, second_solutions, first_demands,
def
get_user_portrait_log
(
cl_id
):
def
get_user_portrait_log
(
cl_id
):
try
:
#
try:
sql
=
"""select cl_id,event_cn, first_solutions, second_solutions, first_demands,
sql
=
"""select cl_id,event_cn, first_solutions, second_solutions, first_demands,
second_demands, first_positions, second_positions, projects
second_demands, first_positions, second_positions, projects
from kafka_tag3_log where cl_id in {} """
.
format
(
tuple
(
cl_id
))
from kafka_tag3_log where cl_id in {} """
.
format
(
tuple
(
cl_id
))
...
@@ -454,9 +454,9 @@ def get_user_portrait_log(cl_id):
...
@@ -454,9 +454,9 @@ def get_user_portrait_log(cl_id):
db
.
close
()
db
.
close
()
cursor
.
close
()
cursor
.
close
()
return
data
return
data
except
Exception
as
e
:
#
except Exception as e:
print
(
e
)
#
print(e)
return
None
#
return None
def
user_portrait_action_statistic
(
cl_id
):
def
user_portrait_action_statistic
(
cl_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