How to structure Tabular data with time series ? League of Legends

(Confetti) #1

hello everyone ! :smiley:

Before posting, i tried to find other posts on the forum or medium posts explaining what i am looking for but actually i did not find. Maybe i miss something ?

I’m new since one month on fast.ai, i was before learning IA/Deep learning on coursera with Prof NG.

Here are my questions :

From RIOT API (game : league of legends), i am able to download all available information linked to “ranked” games. Data is quite similar to https://www.kaggle.com/paololol/league-of-legends-ranked-matches

In this dataset from Kaggle, you can remark that player “role” is available : TOP, MID, JUNGLER, ADC, SUPPORT. In football, it’s equivalent to goalkeeper, defenders, attacking players … However, when downloading data from Riot API, this information is not available and have to be “created”.

For that, i start to work on this “classification” issue. We may want to predict player role based on the data accumulated about the matches. We access to a set of instances (matches), a collection of features (such as players id, all actions done by players during the match linked to a timeline, players level, gold earned …) for each. The target variable is the role (top, mid, adc, support, jungler).

I don’t know how to structure this data in order to put into into a random forest or deep learning model.

How should be the structure of this panda dataframe / csv file ?
Do i have to list all matches in the first column, and for each match list all players id in different columns ? Here, the problem is how to structure all actions done by players in other columns, how do we linked an action column such as “number of kills” to a specific “players id” which is in an other column. :sweat_smile:

Do i need to have one “player id” by line in the data frame and thus have :

match id n1 - player 1 - number of kill - gold earned -
match id n1 - player 2 - number of kill - gold earned -
match id n1 - player 3 - number of kill - gold earned -
match id n1 - player 4 - number of kill - gold earned -
match id n1 - player 5 - number of kill - gold earned -
match id n1 - player 6 - number of kill - gold earned -
match id n1 - player 7 - number of kill - gold earned -
match id n1 - player 8 - number of kill - gold earned -
match id n1 - player 9 - number of kill - gold earned -
match id n1 - player 10 - number of kill - gold earned -

match id n10 - player 1 - number of kill - gold earned -

With this structure, how can i use the data linked to match time line ? As an example, i would need to know at which time, player id n1 has killed an other player and thus analyzed some patern betwenn time, action and player position. Also I need to do this for each match.

Actually, i think i need to find more information about how to structure tabular data, such as for a list of matches with time series associated. How would you structured a such table for football, with all actions and variables linked to players associated to time for all season matches ?

Thank a lot for the help, I hope i am clear in my description

0 Likes

#2

Seems like you are trying to do transactional analysis on aggregated data - is this correct? You could add a bunch of columns for first kill, second kill etc., with a repeating set of what role was killed, how long since last kill, and whatever else you have. Probably better to create pseudo-transactional data with a different datapoint for each event, with incremental time, and incremental gold earned etc since last event.

That will do for a random forest or other traditional ML model. If you want to do deep learning, you might work through the Rossmann approach to categorical data for some ideas. Fastai covers this in most versions of the course. That analysis has a time-series aspect as well, so a good choice to study either way.

0 Likes