Since most of my family hails from Maryland, I have to have some allegiance to the Maryland Terrapins Women’s Basketball team. I decided to look at last year’s Big 10 Conference, seeing as Maryland won the 2016-2017 Big 10 Tournament. Data can be found here, with information for each individual team obtained by clicking on the appropriate link.
The first task to ranking the teams post-conference is to create an adjacency matrix and an array of the team names. After the matrix is created, it is possible to then find the dominant eigenvector for said matrix. The following code outlines the above process.
big_ten_2017 = ['Maryland', 'Ohio', 'Michigan', 'Indiana', 'Purdue',
'Michigan State', 'Penn State','Northwestern', 'Iowa',
'Minnesota', 'Illinois', 'Wisconsin', 'Nebraska', 'Rutgers',
]
import numpy as np
M = np.matrix([
[0,0,1,1,1,1,1,1,2,2,2,1,1,1], #Maryland
[1,0,1,1,1,0,1,1,1,2,1,2,2,1], #Ohio
[0,0,0,1,1,0,0,1,1,1,1,2,2,1], #Michigan
[0,0,1,0,1,0,2,1,1,1,1,1,0,1], #Indiana
[0,0,0,0,0,2,1,1,1,1,1,1,1,1], #Purdue
[0,1,1,1,0,0,1,0,0,2,1,1,1,0], #Michigan State
[0,0,1,0,1,0,0,1,1,1,2,1,1,0], #Penn State
[0,0,0,1,1,1,0,0,0,0,1,1,1,2], #Northwestern
[0,0,0,0,0,1,0,1,0,1,1,1,1,2], #Iowa
[0,0,0,0,0,0,0,1,0,0,1,1,1,1], #Minnesota
[0,0,0,0,0,0,0,0,1,0,0,0,1,1], #Illinois
[0,0,0,0,0,0,0,0,0,0,1,0,1,1], #Wisconsin
[0,0,0,1,0,1,0,0,0,0,0,0,0,1], #Nebraska
[0,0,0,0,0,1,1,0,0,0,0,1,0,0], #Rutgers
])
from scipy.linalg import eig
vals, vecs = eig(M)
vals
#Out[]: array([ 5.81307191+0.j , -0.50294621+2.76406247j,
-0.50294621-2.76406247j, -0.20073325+1.55404447j,
-0.20073325-1.55404447j, -0.33720888+1.19311789j,
-0.33720888-1.19311789j, 0.23130464+0.14723498j,
0.23130464-0.14723498j, -0.95209379+0.64741278j,
-0.95209379-0.64741278j, -1.04788214+0.j ,
-0.62091740+0.52722402j, -0.62091740-0.52722402j])
Given that the first value is the largest, that is our dominant eigenvector. We can then utilize that eigenvector to give us a preliminary possible ranking of the teams, demonstrated by the following code.
vec = abs(vecs[:,0])
ranking = np.argsort(vec).tolist()
ranking.reverse()
[big_ten_2017[i] for i in ranking]
#Out[]: ['Ohio',
'Maryland',
'Indiana',
'Michigan State',
'Purdue',
'Michigan',
'Penn State',
'Northwestern',
'Iowa',
'Nebraska',
'Rutgers',
'Minnesota',
'Illinois',
'Wisconsin']
What is interesting is that this is fairly different from the actual post-conference/pre-tournament ranking assigned to each team, the largest jump being three places down or up for a few teams. I believe this to be because many teams had equal win-loss records and this method of ranking does not take into account any other factors.
Finally, we can use our current information to create an array of relative strengths for each team based on our eigenvector.
[vec[i] for i in ranking]
#Out[]: [0.47544101300304487,
0.46283013935113881,
0.31489498150366696,
0.30504622085468475,
0.29827886993275543,
0.2867578121473966,
0.24613018619686708,
0.23626300025249711,
0.18881821077068381,
0.1244837750650855,
0.10369193429466309,
0.10111087795354988,
0.071733831312807153,
0.051592263966288257]