def ladder(self): s = sorted(self.scores, key=self.scores.get) rat = Rating() newR = rat.rate(s) for i in range(4): s[i].rating = round(newR[i]) s[i].games += 1 s[i].points += self.scores[s[i]] s[i].place[i] += 1
from cityCode_process import CityProcess from lda import LDAProcess from rating import Rating import numpy as np import matplotlib.pyplot as plt city = CityProcess() rate = Rating() cities = city.loadData() lda = LDAProcess() lda.loadData() n_groups = 5 res1 = rate.rate("topic/topic0.txt") res2 = rate.rate("topic/topic1.txt") res3 = rate.rate("topic/topic2.txt") res4 = rate.rate("topic/topic3.txt") res5 = rate.rate("topic/topic4.txt") res6 = rate.rate("topic/topic5.txt") res7 = rate.rate("topic/topic6.txt") res8 = rate.rate("topic/topic7.txt") res9 = rate.rate("topic/topic8.txt") res10 = rate.rate("topic/topic9.txt") fig, ax = plt.subplots() index = np.arange(n_groups) bar_width = 0.15 opacity = 0.4 res11 = []