-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathranking_profiles.py
More file actions
107 lines (98 loc) · 3.42 KB
/
ranking_profiles.py
File metadata and controls
107 lines (98 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
"""Ranking intent profiles for deterministic player scoring."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Literal
RankingIntent = Literal[
"strongest",
"clutch",
"underrated",
"overrated",
"consistent",
"upset_heavy",
"activity_monsters",
]
@dataclass(frozen=True)
class MetricWeight:
metric: str
weight: float
direction: Literal["asc", "desc"] = "desc"
@dataclass(frozen=True)
class RankingProfile:
intent: RankingIntent
label: str
description: str
weights: tuple[MetricWeight, ...]
RANKING_PROFILES: dict[RankingIntent, RankingProfile] = {
"strongest": RankingProfile(
intent="strongest",
label="Strongest Players",
description="Overall strongest by weighted win rate and opponent strength.",
weights=(
MetricWeight("weighted_win_rate", 0.55, "desc"),
MetricWeight("opponent_strength", 0.40, "desc"),
MetricWeight("activity_score", 0.05, "desc"),
),
),
"clutch": RankingProfile(
intent="clutch",
label="Most Clutch Players",
description="Outperform seed and convert upsets against strong opponents.",
weights=(
MetricWeight("upset_rate", 0.40, "desc"),
MetricWeight("avg_seed_delta", 0.35, "asc"),
MetricWeight("opponent_strength", 0.15, "desc"),
MetricWeight("weighted_win_rate", 0.10, "desc"),
),
),
"underrated": RankingProfile(
intent="underrated",
label="Most Underrated Players",
description="Players who consistently outperform seed expectations.",
weights=(
MetricWeight("avg_seed_delta", 0.70, "asc"),
MetricWeight("upset_rate", 0.20, "desc"),
MetricWeight("activity_score", 0.10, "desc"),
),
),
"overrated": RankingProfile(
intent="overrated",
label="Most Overrated Players",
description="Players who underperform seed expectations.",
weights=(
MetricWeight("avg_seed_delta", 0.75, "desc"),
MetricWeight("upset_rate", 0.15, "asc"),
MetricWeight("activity_score", 0.10, "desc"),
),
),
"consistent": RankingProfile(
intent="consistent",
label="Most Consistent Players",
description="Stable performance and reliability across events.",
weights=(
MetricWeight("weighted_win_rate", 0.45, "desc"),
MetricWeight("avg_seed_delta", 0.30, "asc"),
MetricWeight("activity_score", 0.25, "desc"),
),
),
"upset_heavy": RankingProfile(
intent="upset_heavy",
label="Most Upset-Heavy Players",
description="Players most associated with upset-driven results.",
weights=(
MetricWeight("upset_rate", 0.70, "desc"),
MetricWeight("avg_seed_delta", 0.20, "asc"),
MetricWeight("activity_score", 0.10, "desc"),
),
),
"activity_monsters": RankingProfile(
intent="activity_monsters",
label="Most Active Players",
description="High activity and strong event-volume participation.",
weights=(
MetricWeight("activity_score", 0.55, "desc"),
MetricWeight("avg_event_entrants", 0.20, "desc"),
MetricWeight("large_event_share", 0.15, "desc"),
MetricWeight("weighted_win_rate", 0.10, "desc"),
),
),
}