In an attempt to make quick money against friends, we created this computer program that analyzes current season trends and uses math/statistics to predict scores and win percentages.
Authors: Zayd Alzein and Andrew Isenhart
pip install -r requirements.txt
python main.py
We created a Poisson Distribution in the python code using SciPy
Heatmapping the values from each poisson calculation would give us a graph similar to this: Using all the data from the distribution, we are able to find the win percentage by summing the percentages of the situations where one team scores higher than another. Afterwards we calculate tie percentages using the same method.
Visual of cells that would be added together in order to find a win percentage.
def calculate_score(self):
t1=leagueGF*(self.home['Attack Strength']*self.away["Defense Strength"])
t2=leagueGF*(self.away['Attack Strength']*self.home["Defense Strength"])
return(t1,t2) #home, away
for i in teamsData:
teamsData[i]['Attack Strength']=(teamsData[i]['GF']/teamsData[i]['Games Played'])/leagueGF
teamsData[i]['Defense Strength']=(teamsData[i]['GA']/teamsData[i]['Games Played'])/leagueGA
return teamsData