Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1]

Author Topic: Plotting cards with DATA  (Read 611 times)

0 Members and 1 Guest are viewing this topic.

trivialknot

  • Minion
  • *****
  • Offline Offline
  • Posts: 586
  • Respect: +918
    • View Profile
Plotting cards with DATA
« on: May 24, 2018, 04:54:43 pm »
+10

Recently I did some analysis of game logs in order to calculate the "impact factor" of each card.  This is based on 140k 2-player pro-rated games on Isotropic, in which at least one player was ranked in the top 100.  The data only includes expansions up to Guilds.

For my next analysis, I wanted not to rank cards by impact, but characterize/classify cards by type.  I applied Principal component Analysis (PCA), which basically uses a small number of dimensions to describe as much variance among the cards as possible.

The details

I'm going to start out by saying, if you don't understand any of this, and/or you think it's all bullshit, that's okay.  Really, it's just fun to look at the plots whether or not you think they reflect any deeper meaning.  Anyways I'm not going to go into every little detail.  You can ask me anything, or else you can pm me and I'll give you a github link.

In order to do this analysis, I defined two relations, which I call "promote" and "love".  Prom(X,Y) is the extent to which the gain percentage of Y increases when X is present.  Love(X,Y) is the extent to which the gain percentage of X increases relative to other cards, when Y is present.  For each card X, I calculated 412 features corresponding to Prom(X,Y) and Love(X,Y) for each card Y.  I also applied some normalization so that my analysis doesn't care so much about how much it promotes/loves other cards, but rather, which cards it promotes/loves.

Additionally, you might notice that each card is assigned a certain color.  These are based on a basic cluster analysis.  I created seeds for 9 clusters (villages, terminal draw, nonterminal draw, trashing, junking, gaining, payoff, victory), and I used some algorithm to infer classifications for the rest of the cards.  The clustering algorithm is not very good, don't ask me why Rats is a village.  Anyways, it's a guide to the eye.

Requests

Here I show a few sample plots, but I can generate more upon request.  Just ask for Component X vs Component Y.  You can also ask one or both of the axes to show the set of cards loved/promoted by component X.

If you would like to request I change my analysis completely, I'll consider it but I may not have time for that.

Plots

Without further ado, here are a few plots to start out.









Additional notes

By inspection, I believe the first 6 components correspond to:

1. Important terminal cards vs villages
2. 5-cost cards, vs things that help you get 5-costs
3. Thinners vs cards that are best in thin decks
4. Slog cards vs engine cards
5. Trashing vs draw
6. Cheap cards and defense cards vs strong attacks and gainers

After #6, I couldn't tell what the components were getting at.  Most components describe card types that are complementary to each other.  For instance villages tend to love/promote terminals.  Component 4 seems to be a major exception, in that engine cards seem to love/promote other engine cards.  So component 4 describes cards that prefer to be unmixed.
Logged

trivialknot

  • Minion
  • *****
  • Offline Offline
  • Posts: 586
  • Respect: +918
    • View Profile
Re: Plotting cards with DATA
« Reply #1 on: May 24, 2018, 04:54:56 pm »
+1

[reserved for requests]
Logged

fisherman

  • Chancellor
  • ***
  • Offline Offline
  • Posts: 20
  • Shuffle iT Username: fisherman
  • Respect: +21
    • View Profile
Re: Plotting cards with DATA
« Reply #2 on: May 24, 2018, 08:08:19 pm »
0

Could you make the pictures larger so that the labels are not all on top of each other? It's very hard to read the names of the cards now.
Logged

fisherman

  • Chancellor
  • ***
  • Offline Offline
  • Posts: 20
  • Shuffle iT Username: fisherman
  • Respect: +21
    • View Profile
Re: Plotting cards with DATA
« Reply #3 on: May 24, 2018, 09:10:36 pm »
0

Observation #1: It's nice to see Throne Room and Ironmonger clearly identified by component 1 as sitting among the villages, although neither card says "+2 actions" on it. Ironmonger seems to cluster with the nonterminal draw though instead of the villages (if I understand the color coding correctly), which is also reasonable.
Logged

fisherman

  • Chancellor
  • ***
  • Offline Offline
  • Posts: 20
  • Shuffle iT Username: fisherman
  • Respect: +21
    • View Profile
Re: Plotting cards with DATA
« Reply #4 on: May 24, 2018, 09:26:53 pm »
0

Observation #2: Warehouse and Oasis cluster with the trashers. I guess the point is that they help you deal with junk cards in your deck. But Warehouse and Oasis are fairly neutral in component 3. The positive end of component 3 is clearly actual trashing. I very much don't understand what the negative end of component 3 means. trivialknot suggests "cards that are best in thin decks" but that doesn't match my understanding of Thief and Bureaucrat, which are among the most negative in component 3. I can't think of a card property that is most exhibited by the pair of cards Thief and Outpost. They both often gain you mediocre cards?
Logged

popsofctown

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5224
  • Respect: +2682
    • View Profile
Re: Plotting cards with DATA
« Reply #5 on: May 25, 2018, 03:05:48 am »
0

Observation #2: Warehouse and Oasis cluster with the trashers. I guess the point is that they help you deal with junk cards in your deck. But Warehouse and Oasis are fairly neutral in component 3. The positive end of component 3 is clearly actual trashing. I very much don't understand what the negative end of component 3 means. trivialknot suggests "cards that are best in thin decks" but that doesn't match my understanding of Thief and Bureaucrat, which are among the most negative in component 3. I can't think of a card property that is most exhibited by the pair of cards Thief and Outpost. They both often gain you mediocre cards?
I'll take "lower power terminals that gain a card costing 0$-6$ while providing a miscellaneous additional benefit" for 400$ Mr. Trebek.
Logged
Also you probably are an expert if you buy two bureaucrats early.

trivialknot

  • Minion
  • *****
  • Offline Offline
  • Posts: 586
  • Respect: +918
    • View Profile
Re: Plotting cards with DATA
« Reply #6 on: May 25, 2018, 11:25:23 am »
0

Could you make the pictures larger so that the labels are not all on top of each other? It's very hard to read the names of the cards now.
I can make the pictures larger relative to the text, but at some point the graphs just won't fit on mobile screens, and the text will be too small, and still overlapping anyways.  I'll look into solutions, and the images may be updated retroactively.

trivialknot suggests "cards that are best in thin decks" but that doesn't match my understanding of Thief and Bureaucrat, which are among the most negative in component 3. I can't think of a card property that is most exhibited by the pair of cards Thief and Outpost. They both often gain you mediocre cards?
Thief is usually terrible, but one of the few effective use cases is when your opponent has trashed down with e.g. Chapel, and is trying to build up with Silver.  Bureaucrat is also usually terrible, but might be good for injecting payoff in a heavily thinned deck.  Outpost is also best in a thin engine, because that increases the chances that the extra turn kicks off.  These three examples make a lot of sense to me, although I admit that some of the cards that are negative in component 3 appear to just be weak terminals, like Duchess or Navigator.
Logged

trivialknot

  • Minion
  • *****
  • Offline Offline
  • Posts: 586
  • Respect: +918
    • View Profile
Re: Plotting cards with DATA
« Reply #7 on: May 25, 2018, 01:58:24 pm »
+1

I found a package that adjusts the positions of the labels to overlap less often.  The images are updated, although they may not refresh right away on your browser.  Thanks for the feedback!
Logged

Kirian

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 7058
  • Shuffle iT Username: Kirian
  • An Unbalanced Equation
  • Respect: +9285
    • View Profile
Re: Plotting cards with DATA
« Reply #8 on: May 25, 2018, 06:38:33 pm »
0

I... don't understand what Component 1/2/3/4 mean here.  Could you give a brief explanation?
Logged
Kirian's Law of f.DS jokes:  Any sufficiently unexplained joke is indistinguishable from serious conversation.

trivialknot

  • Minion
  • *****
  • Offline Offline
  • Posts: 586
  • Respect: +918
    • View Profile
Re: Plotting cards with DATA
« Reply #9 on: May 25, 2018, 09:35:49 pm »
+3

I... don't understand what Component 1/2/3/4 mean here.  Could you give a brief explanation?
Principal Component Analysis (PCA) is a standard data analysis technique, but it's hard to intuitively understand.  Basically, it tries to describe data using a small number of dimensions.  If your data is spread more or less along a straight line, then the location along that line will be the first component.  If your data is spread more or less along a flat plane, then the location within that plane will be the first two components.

To give an example, suppose I had a survey to ask people about politics.  There are 10 questions, and the answer to each question is a number 1-5.  Thus each person can be placed within a 10-dimensional space.  But I could apply PCA to reduce it to just two dimensions.  PCA won't really tell you what the dimensions mean, but you might look at the data and say, "this first component looks like the left/right spectrum and the second component is the libertarian/authoritarian spectrum."

The same applies here.  PCA generates components that seem to be meaningful, but it won't tell you exactly what the meaning is.  When I say component 1 is "villages vs terminals", that's just my subjective judgment based on looking at the graphs.
Logged

Cave-o-sapien

  • Jester
  • *****
  • Offline Offline
  • Posts: 817
  • Respect: +1474
    • View Profile
Re: Plotting cards with DATA
« Reply #10 on: May 25, 2018, 11:31:30 pm »
0

What proportion of the variance is explained by PCs 1, 2, etc?
Logged

trivialknot

  • Minion
  • *****
  • Offline Offline
  • Posts: 586
  • Respect: +918
    • View Profile
Re: Plotting cards with DATA
« Reply #11 on: May 26, 2018, 12:44:59 am »
+1

What proportion of the variance is explained by PCs 1, 2, etc?
For the first ten components: 0.12466628  0.10312049  0.07666992  0.05565225  0.047911  0.04449083  0.03309127  0.02486287  0.02174379  0.02077453

In total, that's 55%, which means it's pretty hard to describe Dominion cards even with 10 dimensions.
Logged
Pages: [1]
 

Page created in 0.098 seconds with 20 queries.