I was a little surprised how easy it was to set this up, as, in this case, the basic set up is identical to when I was doing power rankings with regression
Code: Select all
X = zeros( (number_of_games, number_of_teams) )
y = zeros( (number_of_games, 1) )
#Fill X with 1s and -1s (for home&away team)
#Fill y with 1s and 0s (1: hometeam won, 0: hometeam lost)
Code: Select all
net = net.newff([[-1, 1], [-1, 1]...[-1, 1]], [1])
Code: Select all
net.train(X, y, epochs=500, show=100, goal=0.02)
Code: Select all
X = np.zeros( (1, 30) )
X[0, column_of_hometeam] = 1
X[0, column_of_awayteam] = -1
out = net.sim(X)
This specific example is using a Feed Forward Multilayer Perceptron with no middle layer(s). I don't really see how a middle layer would help here.
With no middle layer, training the network is really fast (~4 seconds on a decent PC)
Here's the "power ranking" given by the NN
Code: Select all
╔═══════════════════════════════╦══════════╗
║ Team ║ Exp Win% ║
╠═══════════════════════════════╬══════════╣
║ San Antonio Spurs _2014 ║ 77.4 ║
║ Oklahoma City Thunder _2014 ║ 74.0 ║
║ Los Angeles Clippers _2014 ║ 71.2 ║
║ Houston Rockets _2014 ║ 68.2 ║
║ Portland Trail Blazers _2014 ║ 67.7 ║
║ Indiana Pacers _2014 ║ 65.9 ║
║ Miami Heat _2014 ║ 65.0 ║
║ Golden State Warriors _2014 ║ 63.7 ║
║ Memphis Grizzlies _2014 ║ 62.9 ║
║ Dallas Mavericks _2014 ║ 61.3 ║
║ Phoenix Suns _2014 ║ 60.1 ║
║ Chicago Bulls _2014 ║ 56.7 ║
║ Toronto Raptors _2014 ║ 56.4 ║
║ Brooklyn Nets _2014 ║ 51.5 ║
║ Washington Wizards _2014 ║ 51.1 ║
║ Minnesota Timberwolves _2014 ║ 50.6 ║
║ Charlotte Bobcats _2014 ║ 50.3 ║
║ Denver Nuggets _2014 ║ 46.2 ║
║ Atlanta Hawks _2014 ║ 44.8 ║
║ New Orleans Pelicans _2014 ║ 43.8 ║
║ New York Knicks _2014 ║ 43.1 ║
║ Cleveland Cavaliers _2014 ║ 38.0 ║
║ Sacramento Kings _2014 ║ 36.6 ║
║ Los Angeles Lakers _2014 ║ 35.2 ║
║ Detroit Pistons _2014 ║ 33.5 ║
║ Utah Jazz _2014 ║ 32.8 ║
║ Boston Celtics _2014 ║ 28.4 ║
║ Orlando Magic _2014 ║ 25.7 ║
║ Philadelphia 76ers _2014 ║ 20.9 ║
║ Milwaukee Bucks _2014 ║ 17.1 ║
╚═══════════════════════════════╩══════════╝
So far so good.
The problem I could see NN having is that they have no built-in regression to the mean like Ridge Regression does. Maybe there's a way to design them so that they do, but I don't know. That's not too big of a problem here, but probably will be if you try to use a NN for NBA matchupdata where many players have played few possessions