def plot_abilities_one_components(self, team_ids, **kwargs):
import matplotlib.pyplot as plt
import seaborn as sns
figsize = kwargs.get('figsize',(15,5))
if self.latent_variables.estimated is False:
raise Exception("No latent variables estimated!")
else:
plt.figure(figsize=figsize)
if type(team_ids) == type([]):
if type(team_ids[0]) == str:
for team_id in team_ids:
plt.plot(np.trim_zeros(self._model_abilities(self.latent_variables.get_z_values()).T[self.team_dict[team_id]],
trim='b'), label=self.team_strings[self.team_dict[team_id]])
else:
for team_id in team_ids:
plt.plot(np.trim_zeros(self._model_abilities(self.latent_variables.get_z_values()).T[team_id],
trim='b'), label=self.team_strings[team_id])
else:
if type(team_ids) == str:
plt.plot(np.trim_zeros(self._model_abilities(self.latent_variables.get_z_values()).T[self.team_dict[team_ids]],
trim='b'), label=self.team_strings[self.team_dict[team_ids]])
else:
plt.plot(np.trim_zeros(self._model_abilities(self.latent_variables.get_z_values()).T[team_ids],
trim='b'), label=self.team_strings[team_ids])
plt.legend()
plt.ylabel("Power")
plt.xlabel("Games")
plt.show()
评论列表
文章目录