How well can a computer guess MTG card colors from just ability text?

Dale Kellegrew
2 min readDec 18, 2019

I’ve played Magic the Gathing (TM) for almost 20 years now. When a new set comes out the MTG community flocks around the new spoilers to see if there is an overpowered card or something we can “break” for constructed magic.

I, on the other hand, love to draft MTG. Meaning I’m not looking at the flashy rares or mythics which I will almost never play with. I’m looking at the common and uncommon cards in the set to see if there is a sneaky path I can use to win on Friday nights. These common and uncommon cards usually follow the magic “color wheel” example: Red is all about throwing fireballs at your opponent’s things, Green is about big creatures with trample, etc. I wondered if I could use ML to give me an idea on how distinct each set’s color pie was.

MTG basic color wheel

So I went to Wizards of the Coast’s website looking for an API. I happening across an amazing python rapper that made getting all the data I wanted super simple! Thanks WoTC for making your data simple to extract. https://github.com/MagicTheGathering/mtg-sdk-python

I made sure to drop the cards that fell into 2 or more colors since there are not that many in core sets anyways so that I only had to deal with single color cards.

I pulled 4 core sets card ability data, OneHotEncoded it to vectorize the card texts, and then put it into a Multinominal Bayes Classifier.

My Bayes Classifier was able to guess ‘colorless’ cards correctly 72% of the time while only guessing ‘green’ cards correctly 55% of the time. This points to green cards having less of a color idenity that colorless cards since the MN-Bayes classifier had a harder time guessing the color correctly.

Make green cards more distinct WoTC.

--

--