Commit d8cc9dfe authored by 赵威's avatar 赵威

add score

parent ad8ef78a
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment