-
Data collection:
- Use dota2py wrapper of Steam Web API
- Use
get_match_history_by_sequence_num
to obtain all matches following a sequence number - Use DotaMax to obtain match skill level
- Check whether the math is stored or parsed by yasp. Grab the yasp data if yes.
- In this experiment, use only All Pick games of all skill levels and at least 25 minutes.
- In total ~80K matches
- Run
python crawler.py <start_seqnum> <end_seqnum>
to crawl data- Current crawl to sequence number: 1663750000 on lille
-
Learn low-dimension embedding of Dota2 heroes via skip-n gram model.
- Efficient Estimation of Word Representations in Vector Space
- Treat each team as a sentence
- Treat each hero as a word
- Use uniformly sampled heroes as negative instances
-
Learn low-dimension embedding of Dota2 items via skip-n gram model.
- Treat all items possessed by same player as a sentence
- Treat each item as a word
- We learn item embedding only from winning team
- Use uniformly sampled heroes as negative instances
-
visualization:
- Use different methods in sklearn to project the embedding into 2D
- TSNE
- Isomap
- MDS
- Spectral
- PCA
- Use different methods in sklearn to project the embedding into 2D
-
All data are stored in Mongodb in lille.
-
Run following script to learn embedding
python learn_embedding.py [hero/item] [match filter dict]
Example: use all matches with mode all pick or ranked all picked lasting at least 25 minutes
python learn_embedding.py item "{'\$or': [{'game_mode': 1}, {'game_mode': 22}], 'duration': {'\$gt': 1500}}"
-
Run script to generate visualization webpage Visualize hero embedding:
python draw_hero_embedding.py embed_weight_hero.pkl mds,tsne,isomap,spectral,pca
Visualize item embedding:
python draw_item_embedding.py embed_weight_item.pkl mds,tsne,isomap,spectral,pca
We briefly annotated the visualization result by PCA as follows:
We query the nearest neighbor of a given hero using the learned embedding.
We query the nearest neighbor of a given item using the learned embedding.
Item | Nearest Items |
---|---|