如何将 Elo 评级转换为 5 星评级系统?

How to convert Elo rating to 5 star rating system?

我们有一个视频游戏玩家的 Elo 评级系统(如下所示),并希望将其转换为 5 星评级,范围从 [3.00, 5.00]。转换应保持以下四个约束。也就是说,我们要确保玩家的评分是 'well distributed'。

示例 Elo 评级和所需的转换五星级评级:

elo_ratings = [1295, 1497, 1014, 967, 1021, 1034, 1162, 1198, 1374, 1242, 1292, 1096, 1339, 1365, 1188, 1075, 1344, 1040, 1334, 1513, 1362, 1038, 1177, 1190, 1583, 1551, 1558, 1245, 1202, 1285, 1171, 1223, 1274, 1514, 950]

#ranging from 3 to 5
five_star_ratings = [3.52, 4.10, 3.2, ...]

任何人都可以帮助或提供有关数学或实现的一些信息吗?

您可以为此使用 numpy 中的几个函数 - np.percentile and np.interp

代码:

import numpy as np

elo_ratings = [1295, 1497, 1014, 967, 1021, 1034, 1162, 1198, 1374, 1242, 1292, 1096, 1339, 1365, 1188, 1075, 1344, 1040, 1334, 1513, 1362, 1038, 1177, 1190, 1583, 1551, 1558, 1245, 1202, 1285, 1171, 1223, 1274, 1514, 950]

rankings = [3.0, 3.5, 4.0, 4.95, 5.0]

boundaries = np.percentile(elo_ratings, [0, 25, 50, 75, 100])

ratings = np.interp(elo_ratings, boundaries, rankings)

输出

>>> ratings
array([4.4536036 , 4.98130435, 3.17877095, 3.04748603, 3.19832402,
       3.23463687, 3.6460177 , 3.80530973, 4.95456522, 4.        ,
       4.42792793, 3.40782123, 4.83018018, 4.9526087 , 3.76106195,
       3.34916201, 4.87297297, 3.25139665, 4.78738739, 4.98478261,
       4.95195652, 3.24581006, 3.71238938, 3.7699115 , 5.        ,
       4.99304348, 4.99456522, 4.02567568, 3.82300885, 4.36801802,
       3.68584071, 3.9159292 , 4.27387387, 4.985     , 3.        ])