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
d8cc9dfe
Commit
d8cc9dfe
authored
Nov 12, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add score
parent
ad8ef78a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
tool.py
eda/smart_rank/tool.py
+14
-0
No files found.
eda/smart_rank/tool.py
View file @
d8cc9dfe
...
...
@@ -301,6 +301,18 @@ def compute_ai_scan(x, decay_days=30, exponential=0, action_tag_count=1):
return
0.5
def
compute_1_score
(
x
,
decay_days
=
30
,
exponential
=
0
,
action_tag_count
=
1
):
if
exponential
:
alpha
=
exponential_decay
(
x
,
decay_days
)
score
=
1
/
action_tag_count
-
1.1
**
alpha
*
((
1
-
0.5
)
/
decay_days
)
else
:
score
=
1
/
action_tag_count
-
x
*
((
1
-
0.5
)
/
decay_days
)
if
score
>
0.5
:
return
score
else
:
return
0.5
def
get_action_tag_count
(
df
,
action_time
):
try
:
if
not
df
[
df
[
"time"
]
==
action_time
]
.
empty
:
...
...
@@ -393,6 +405,8 @@ def compute_tag3_score(x):
return
compute_ai_scan
(
x
.
days_diff_now
,
exponential
=
1
)
elif
x
.
score_type
==
"ruoyixiang"
:
return
compute_ruoyixiang
(
x
.
days_diff_now
,
exponential
=
1
)
elif
x
.
score_type
==
"1_score"
:
return
compute_1_score
(
x
.
days_diff_now
,
exponential
=
1
)
else
:
return
compute_validate
(
x
.
days_diff_now
,
exponential
=
1
)
...
...
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