From eb8a5ebb5d5309a1d850e0db764678a62ea637e9 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Sun, 18 Oct 2020 05:56:03 +0200 Subject: [PATCH] change rating system map prediction accuracy cal The new calculation better takes into account low-confidence wrong predictions which have previously inflated the postive results. --- MapSummary.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MapSummary.py b/MapSummary.py index 8eae11d..759ab56 100644 --- a/MapSummary.py +++ b/MapSummary.py @@ -35,11 +35,15 @@ class MapSummary: try: self.insurgentWinPercent = self.insurgentWins / self.totalGames*100 self.securityWinPercent = self.securityWins / self.totalGames*100 - predictionPercision = 1 - sum(self.predictions)/len(self.predictions) - confidenceAverage = sum(self.confidence) / len(self.confidence) averageSeconds = sum([t.total_seconds() for t in self.times]) / len(self.times) self.averageTime = datetime.timedelta(seconds=int(averageSeconds)) - self.ratingSystemDeviation = predictionPercision*100 - confidenceAverage + + mapper = [ 1 if x == 0 else -1 for x in self.predictions ] + self.ratingSystemDeviation = 0 + for i in range(0, len(self.confidence)): + self.ratingSystemDeviation += mapper[i] * self.confidence[i] + self.ratingSystemDeviation /= self.totalGames + except ZeroDivisionError: pass