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
e32a9664
Commit
e32a9664
authored
Aug 31, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户画像分层影响
parent
3751c44d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
dist_update_portrait_market.py
eda/smart_rank/dist_update_portrait_market.py
+0
-0
dist_update_user_portrait.py
eda/smart_rank/dist_update_user_portrait.py
+8
-1
No files found.
eda/smart_rank/dist_update_portrait_market.py
0 → 100644
View file @
e32a9664
This diff is collapsed.
Click to expand it.
eda/smart_rank/dist_update_user_portrait.py
View file @
e32a9664
...
...
@@ -76,6 +76,12 @@ def compute_validate(x):
return
score
else
:
return
0.5
def
compute_ai_scan
(
x
):
score
=
2
-
x
*
((
2
-
0.5
)
/
180
)
if
score
>
0.5
:
return
score
else
:
return
0.5
def
tag_list2dict
(
lst
,
size
):
result
=
[]
if
lst
:
...
...
@@ -104,7 +110,8 @@ def get_user_tag_score(cl_id, all_log_df, size=10):
user_log_df
[
"tag_score"
]
=
user_log_df
.
apply
(
lambda
x
:
compute_henqiang
(
x
.
days_diff_now
)
if
x
.
score_type
==
"henqiang"
else
(
compute_jiaoqiang
(
x
.
days_diff_now
)
if
x
.
score_type
==
"jiaoqiang"
else
(
compute_ruoyixiang
(
x
.
days_diff_now
)
if
x
.
score_type
==
"ruoyixiang"
else
compute_validate
(
x
.
days_diff_now
))),
axis
=
1
)
compute_ai_scan
(
x
.
days_diff_now
)
if
x
.
score_type
==
"ai_scan"
else
(
compute_ruoyixiang
(
x
.
days_diff_now
)
if
x
.
score_type
==
"ruoyixiang"
else
compute_validate
(
x
.
days_diff_now
)))),
axis
=
1
)
finally_score
=
user_log_df
.
sort_values
(
by
=
[
"tag_score"
,
"time"
],
ascending
=
False
)
finally_score
.
drop_duplicates
(
subset
=
"tag_id"
,
inplace
=
True
)
finally_score_lst
=
finally_score
[[
"tag_id"
,
"tag_score"
]]
.
to_dict
(
'record'
)
...
...
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