3/15/2024 0 Comments Excel solver function numerically# We are going to assume that each team has an inherent performance-factor, # and that there is a bonus for home-field advantage then the # relative final score between a home team and an away team can be # calculated as (home advantage) + (home team factor) - (away team factor) # First we create a matrix M which will hold the data on # who played whom in each game and who had home-field advantage. # From this, we wish to forecast the score of future games. Затем в Python: import csv import numpy import scipy.optimize def readCsvFile(fname): with open(fname, 'r') as inf: return list(csv.reader(inf)) # Get team data team = readCsvFile('teams.csv') # list of num,name numTeams = len(team) # Get game data game = readCsvFile('games.csv') # list of game,home,away,homescore,awayscore numGames = len(game) # Now, we have the NFL teams for 2002 and data on all games played.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |