|
| 1 | +To build the tree for this model, you'll run BuildTree.java. You need to modify the database setting in the code according to your database configuration. |
| 2 | + |
| 3 | +To get the Q-values, you'll run FastValueIteration.java. Set dbname to the name of the sequence tree database, and dbname2 to the output database for the Q-values. |
| 4 | + |
| 5 | +To get the player valuations, run GetPlayerValues.java. Set databaseData to the original dataset, databaseTree to the sequence tree database, databaseValueIteration to the database with the Q-values, and databasePlayerValues to the output database for the player valuations. Also, set metricTable to the table to get Q-values from. |
| 6 | + |
| 7 | +Each row in the output table for GetPlayerValues contains the following: |
| 8 | ++ GameId |
| 9 | ++ EventNumber |
| 10 | ++ PlayerId |
| 11 | ++ FromNodeId |
| 12 | ++ ToNodeId |
| 13 | ++ Action |
| 14 | ++ ActionValue |
| 15 | + |
| 16 | +The main parts you need are GameId, PlayerId, and ActionValue. |
| 17 | + |
| 18 | +To get Net Game Impact, run: |
| 19 | + |
| 20 | +***CREATE TABLE Net_Game_Impact AS |
| 21 | +SELECT GameId, PlayerId, SUM( ActionValue ) AS Net_Game_Impact |
| 22 | +FROM <databasePlayerValues>.playervaluations |
| 23 | +GROUP BY GameId, PlayerId;*** |
| 24 | + |
| 25 | +To get Average Game Impact, run: |
| 26 | + |
| 27 | +***CREATE TABLE Average_Game_Impact |
| 28 | +SELECT GameId, PlayerId, AVG( ActionValue ) AS Average_Game_Impact |
| 29 | +FROM <databasePlayerValues>.playervaluations |
| 30 | +GROUP BY GameId, PlayerId;*** |
| 31 | + |
| 32 | +To get the sum of averages over each season & season type, run: |
| 33 | + |
| 34 | +***CREATE TABLE Season_Sum_Of_Average_Game_Impact |
| 35 | +SELECT A.Season, A.SeasonType, B.PlayerId, SUM( B.Average_Game_Impact ) AS Season_Sum_Of_Average_Game_Impact |
| 36 | +FROM <databaseData>.game AS A |
| 37 | +JOIN Average_Game_Impact AS B |
| 38 | +ON A.GameId = B.GameId |
| 39 | +GROUP BY A.Season, A.SeasonType, B.PlayerId;*** |
0 commit comments