summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2021-03-12 18:33:39 -0700
committerTuowen Zhao <ztuowen@gmail.com>2021-03-12 18:33:39 -0700
commitc1efbec3d4b72f43632cc3a8267593e73294bb54 (patch)
treec9f725609fa0c0eeefceda2eb07aba03e19d2a6f
parent973e01ef3446263bbd000bb2f6e820424257b205 (diff)
downloadlpl-master.tar.gz
lpl-master.tar.bz2
lpl-master.zip
Update init position of k-meansHEADmaster
-rw-r--r--rank.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rank.py b/rank.py
index 3e538a9..0774b54 100644
--- a/rank.py
+++ b/rank.py
@@ -189,7 +189,7 @@ def score_takeall(a, b):
# choose a smoothing function (naive, exp, normal, shock)
smooth_func = smooth_naive
-# choose a score function (naive, fivefive, avgscore, takeall)
+# choose a score function (naive, fivefive, avg, takeall)
score_func = score_naive
for match in reversed(matches):
@@ -237,11 +237,11 @@ for idx, name in enumerate(teams):
team_rank.sort(key=lambda x: x[1], reverse=True)
# Tier list using K-means
-K = 4
+K = 5
rank_name = ["S", "A", "B", "C", "D", "E", "F"]
means = [0] * K
for i in range(K):
- means[i] = team_rank[i * len(teams)//K][1]
+ means[i] = team_rank[(i * len(teams) * 2 + K)//(2 * K)][1]
for i in range(1000):
# calculate distance