andreiapostoae / dota2-predictor

Tool that predicts the outcome of a Dota 2 game using Machine Learning
MIT License
367 stars 82 forks source link

Next pick? #3

Open CyrusDsouza opened 7 years ago

CyrusDsouza commented 7 years ago

What do you think would be a neat approach to predict the next pick based on say, 2 heroes already picked and there onward?

I was just wondering how one would pick a character based on the previous picks. I understand this is far fetched as the remaining picks could influence the already predicted pick (but that would be too late).

What are your thoughts?

mdfwn commented 7 years ago

The model and the data don't preserve information about the picking order, so I think it's not possible to do the usual kind of optimization (where you use backprop to maximize the output with respect to the input).

We could do some brute-force approach or maybe something like Monte-Carlo-Tree-Search (this is what google used for AlphaGo and the problem here sounds similar, but I have never used it so far and I wouldn't know how to implement this) but the question is what are we even trying to optimize? Assuming that Radiant has picked hero A followed by Dire's pick of hero B, we know want to find the best pick C for Radiant, but "best" in what sense, given our model? We could fix a hero for C and then for {A,B,C} we could compute the model's predicted winrate for each draft that contains {A,C} on Radiant and {B} on Dire, this gives us a bunch of values for the choice of C (I think around 10^14 possible configurations). What is now a good metric to say how good C is? Is it the maximum winrate, the minimum winrate, the average winrate? Once we decided that, we can calculate that metric for each possible choice of C (114-2 = 112 possibilities since we have already picked hero A and B) and then pick the C that resulted in the best value of our metric.

Edit: It basically comes down to the fact that the model was trained on complete drafts (10 heroes), not incomplete drafts. This means trying to make a prediction with less than 10 heroes is technically possible (because it will just be 1-hot-encoded and thus the input vector size won't change), but the question is how the network's result can be interpreted.

andreiapostoae commented 7 years ago

I gave it a lot of thought actually. I figured out kind of what @mdfwn said: it's computationally expensive to figure out next pick only having 2 heroes, for example, already inputted. However, if there are, let's say, 7 heroes already picked, I could use minimax or alpha-beta pruning to determine the next best pick in decent time.

But basically, yeah, I still have to check almost all the possibilities for the remaining heroes by querying the pretrained model, as I do for suggesting the last pick.

CyrusDsouza commented 7 years ago

Yes, that makes a lot of sense. Thanks @mdfwn @andreiapostoae