Spaces:
Running
on
Zero
Running
on
Zero
Update scoring_calculation_system.py
Browse files
scoring_calculation_system.py
CHANGED
@@ -624,24 +624,11 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
|
|
624 |
# return max(0.65, min(0.95, amplified)) # 限制在65%-95%範圍內
|
625 |
|
626 |
def amplify_score(score):
|
627 |
-
"""
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
返回:
|
634 |
-
float: 放大後的分數 (0.60-0.95)
|
635 |
-
"""
|
636 |
-
# 基礎分數調整 - 將範圍集中到更有意義的區間
|
637 |
-
adjusted = (score - 0.4) * 1.67
|
638 |
-
|
639 |
-
# 使用更強的指數關係來放大差異
|
640 |
-
# 指數3可以在高分區間產生更明顯的差異
|
641 |
-
amplified = pow(adjusted, 3) / 8 + score
|
642 |
-
|
643 |
-
# 確保分數在60%-95%之間,並保持合理的分布
|
644 |
-
return max(0.60, min(0.95, amplified))
|
645 |
|
646 |
final_score = amplify_score(weighted_score)
|
647 |
|
|
|
624 |
# return max(0.65, min(0.95, amplified)) # 限制在65%-95%範圍內
|
625 |
|
626 |
def amplify_score(score):
|
627 |
+
"""強化分數差異"""
|
628 |
+
adjusted = (score - 0.35) * 1.8
|
629 |
+
amplified = pow(adjusted, 3.5) / 6 + score
|
630 |
+
# 範圍55%-95%
|
631 |
+
return max(0.55, min(0.95, amplified))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
|
633 |
final_score = amplify_score(weighted_score)
|
634 |
|