Cal Mitchell commited on
Commit
21e77ce
1 Parent(s): 6a80d00

changed readme

Browse files
Files changed (2) hide show
  1. README.md +2 -6
  2. example.ipynb +2 -2
README.md CHANGED
@@ -48,12 +48,8 @@ To change the players and their ages, you must reference the `player_tokens.csv`
48
 
49
  For example, if you wanted to subtract Kristaps Porzingis from Boston's team and swap who was home / away, you would take the token representing Porzingis `4416` out of the `home_team_tokens` list, and replace him with, say, Payton Pritchard `4999`. You would then have to look up Pritchard's age (26), find the corresponding age token in `age_tokens.csv`, which is `11`, and replace Porzingis' age token (which is the second to last token).
50
 
51
- To swap home and away, you could replace the variables containing all of the player and age tokens, or just set the `swap_home_away` variable to `True`. The results are as follows:
52
-
53
- ![NBA Finals prediction without Porzingis](porzingis-swapped-for-pritchard.png)
54
-
55
- As you can see, Dallas' win probability improved from 23% to 35%, and their chance of being blown out by 20+ points decreased from 14% to 10%. Clearly, the model thinks Porzingis is important to the Celtics' chances, but still considers Boston to be the superior team without him.
56
 
57
  ## Training Process
58
 
59
- I downloaded data from stats.nba.com using the [https://github.com/swar/nba_api](swar/nba_api) package to get information on minutes played, game outcomes, and a few other dimensional elements to make everything fit together. Then, I ran a custom PyTorch training loop to train the model(s) on their chosen loss objective (spread, money line, or spread probability).
 
48
 
49
  For example, if you wanted to subtract Kristaps Porzingis from Boston's team and swap who was home / away, you would take the token representing Porzingis `4416` out of the `home_team_tokens` list, and replace him with, say, Payton Pritchard `4999`. You would then have to look up Pritchard's age (26), find the corresponding age token in `age_tokens.csv`, which is `11`, and replace Porzingis' age token (which is the second to last token).
50
 
51
+ To swap home and away, you could replace the variables containing all of the player and age tokens, or just set the `swap_home_away` variable to `True`.
 
 
 
 
52
 
53
  ## Training Process
54
 
55
+ I downloaded data from stats.nba.com using the [https://github.com/swar/nba_api](swar/nba_api) package to get information on minutes played, game outcomes, and a few other dimensional elements to make everything fit together. Then, I ran a custom PyTorch training loop to train the model(s) on their chosen loss objective (spread, money line, or spread probability).
example.ipynb CHANGED
@@ -87,8 +87,8 @@
87
  "away_age_tokens = [11, 12, 19, 14, 23, 11, 13, 13]\n",
88
  "\n",
89
  "# Uncomment to take Tatum off team, replace with Pritchard\n",
90
- "away_player_tokens = [4999, 5039, 5027, 4981, 4972, 5004, 4416, 4983]\n",
91
- "away_age_tokens = [11, 12, 19, 14, 23, 11, 13, 13]\n",
92
  "\n",
93
  "# The model usually gives the home team a bump in win probability.\n",
94
  "# Change this to \"True\" to swap home and away teams.\n",
 
87
  "away_age_tokens = [11, 12, 19, 14, 23, 11, 13, 13]\n",
88
  "\n",
89
  "# Uncomment to take Tatum off team, replace with Pritchard\n",
90
+ "# away_player_tokens = [4999, 5039, 5027, 4981, 4972, 5004, 4416, 4983]\n",
91
+ "# away_age_tokens = [11, 12, 19, 14, 23, 11, 13, 13]\n",
92
  "\n",
93
  "# The model usually gives the home team a bump in win probability.\n",
94
  "# Change this to \"True\" to swap home and away teams.\n",