How can I predict rank of a team based on list of team members and past placement?

I just started with ML, so this could potentially be a pretty stupid question, plz forgive me.

Here's the gist of the problem:

I have a list in json format like this:

[
  {
    // Final rank of the team after all the matches are done
    rank: 7,
    // List of team members
    characters: [
      { char_id: my_char_1, level: 2, item_ids: [1, 2, 3] }
      ...
    ]
  }
]

I want to predict the rank for a given team of characters without looking at the competitors. Basically, I want to go from this:

[
  { char_id: my_char_1, level: 2, item_ids: [1, 2, 3]  }
  ...
]

to a single output neuron with a value from 1 to 100.

I parsed the source data into the first json structure, but I'm currently stuck at trying to give Tensorflow pairs of data (team + past rank), ideally in the form of two arrays where elements at a given index belong together.

TLDR:

Assuming this is possible at all (and not a lack of information or something), how do I feed Tensorflow this example data (list of team members - past rank) properly to predict the future rank of a completely new team?


I've found this question which is somewhat similar: Predicting outcome of MOBA team games

Based on this answer, I'm assuming I'll have to normalize the data, so instead of an array I would need a map like this:

{
  my_char_1: null,
  my_char_2: {
    level: 2,
    item_ids: {
      1: true,
      2: false,
      3: true
      ...
    }
  },
  ...
}

However, I struggle with the act of passing the data itself, not so much how to prepare the json structure. Basically, take whatever json structure would be optimal and assume it already exists.

Topic game tensorflow

Category Data Science


This sounds like an interesting problem. Based on what you're trying to achieve, I think you should consider a more classical approach first, rather than diving straight into a neural network. I would consider something like an ordered logistic regression model. This is an extension of logistic regression, handling two or more ordered outcomes.

Since you have your data in a json file, I'd first convert this to a csv. Then load the csv into Python to estimate/train any models. You can then use the data to estimate an ordered logistic regression model. See the Python documentation here.

Your response will be rank (1-10). You can use the characters and items used as predictors. You could also look at interaction terms between the characters and predictors - this is because certain item and character combinations impact the outcome differently. One concern is that this model might become quickly over parameterised. Next you could consider a neural network.

In the neural network, your input nodes will be the characters and items. You'll need to perform a one hot encoding on the rank before you can use it to train the network. Note that you should use a cross entropy loss function, with a softmax activation function on the output layer. It's important to note that this doesn't achieve exactly the same thing as an ordered logistic regression (we're ignoring the fact the outcome is ordered). See this question about setting up a neural network mimic an ordered logistic regression.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.