From Synergy to Lift: The Math Behind EDHREC’s New Era of Recommendations

by
Julia Maddalena
Julia Maddalena
From Synergy to Lift: The Math Behind EDHREC’s New Era of Recommendations

Mercadian LiftMercadian Lift | Art by Gary Ruddell

Today marks the official release and replacement of synergy on EDHREC with lift scores. Synergy scores have long been a staple of EDHREC and have helped many users over the years find cards that have synergistic relationships with commanders or other cards.

After receiving feedback from our users and thoroughly investigating the behavior of synergy scores, we've decided it is time to retire synergy scores in favor of a more mathematically sound replacement.

But why make this change now? Let's take a deep dive into the math behind these changes and what it means for the future of deckbuilding in Commander.

What Is Lift?

Lift is an established metric used in association rule mining that “measures the strength of association between items in a rule compared to what would be expected if they were independent.” (source)

In our case, lift can be a useful metric for measuring how synergistic two cards are based on the deck data EDHREC stores from Moxfield and Archidekt.

Using lift scores calculated from this data, we can determine whether two cards appear together seemingly at random, or more or less frequently than random.

Let’s dive into the math.

Lift is calculated as the probability of any two events A and B co-occurring divided by the product of their individual occurrences:

Equation 1: Lift equals the joint probability of events A and B, Pr(A intersection B), divided by the product of their individual probabilities, Pr(A) times Pr(B).

Pr(A) may be defined as the number of events where A happened divided by the total number of events where A could have happened. 

Equation 2: The probability of A equals the number of occurrences of A divided by the number of potential occurrences of A.

From probability theory, we know that if two events A and B are completely independent, then

Pr of A intersect B equals Pr of A multiplied by Pr of B. This expresses the condition for A and B being independent events.

Therefore, if the numerator and denominator of equation (1) are equal, the lift score will equal 1 and we can conclude that A and B are independent events.

If the lift score is greater than 1, then the events are more likely to co-occur than random, and if the lift score is less than one, then the events co-occur less often than random. 

Lift equals 1: A and B are independent. Lift greater than 1: A and B co-occur more often than expected by random chance. Lift less than 1: A and B co-occur less often than expected by random chance.

How Is Lift Calculated by EDHREC?

Let’s define A and B from Equation 1 as follows:

D sub A: number of decks containing card A. D sub A given Color⁺ of A intersect B: number of decks containing card A within the potential deck color identities of A and B. D sub Color⁺ of A intersect B: total number of decks within the potential deck color identities of A and B.

In the context of EDH, determining these values and especially the number of decks that could contain these cards is unfortunately not straightforward due to two primary considerations:

  1. The dates that both cards were spoiled. 
  2. The color of the cards and the potential deck color identities for those cards.

Point #1 is complicated to implement in code, but intuitive to discuss with words. We must limit the potential decks that could contain the card pair of interest to the most recent of the two dates when each card was spoiled.

Handling of this is implied in the remainder of this writeup but is not explicitly provided in the equations for simplicity’s sake.

Point #2 is especially complex because it differs depending on whether one of the cards in consideration is a commander, as the commander’s color identity is the only color identity to consider.

For example, a green/white () card and white () card could occur in any of the following color identities:

However, if the GW card is the commander, the color identity is definitively GW and would be the only color identity we would consider. Consider the following notation to help with this:

Color superscript plus of A intersect B: the potential color identities of decks that can include both card A and card B. Color of C: the definitive color identity of the commander C.

Before getting to the lift score calculations, let’s define the following final notation:

D sub A: number of decks containing card A. D sub A given Color⁺ of A intersect B: number of decks containing card A within the potential deck color identities shared by A and B. D sub Color⁺ of A intersect B: total number of decks within the potential deck color identities of A and B.

When considering card-to-card lift scores, we use the following formula based on Equation 1 and the additional constraints mentioned above.

Equation 3: Lift of A and B equals the fraction (D sub A intersect B divided by D sub Color⁺ of A intersect B) over [(D sub A given Color⁺ of A intersect B divided by D sub Color⁺ of A intersect B) multiplied by (D sub B given Color⁺ of A intersect B divided by D sub Color⁺ of A intersect B)]. This computes Lift while conditioning on the potential color identities that allow both A and B to appear in the same deck.

The equation differs slightly when considering commander-to-card lift scores simply due to the more straightforward color identity determination when a commander is involved.

Equation 4: Lift of A and commander C equals the fraction (D sub A intersect C divided by D sub Color of C) over [(D sub A given Color of C divided by D sub Color of C) multiplied by (D sub C divided by D sub Color of C)]. This measures how strongly card A and commander C co-occur relative to what would be expected within that commander’s color identity.

Comparison to Synergy

One of the major important distinctions between lift and synergy scores is that lift behaves logarithmically.

For example, a lift score of 0.5 implies just as extreme of a negative association as a score of 2.0 implies positive association.

Furthermore, lift scores are bounded by 0 on the lower end and can theoretically be as large as ∞. This differs from synergy which was symmetric about 0 and restricted to the range (-100%, +100%). 

Two color bars comparing Lift and Synergy score ranges. Lift ranges from 0.01 to 100, colored red to green with 1 at the midpoint. Synergy ranges from –100 to +100, colored red to green with 0 at the midpoint

Additionally, synergy scores are not symmetric, as they're based on the following equation:

Equation 5: Synergy of B given A equals (D sub A intersect B divided by D sub A given Color⁺ of A intersect B) minus (D sub A divided by D sub Color⁺ of A).

This means that when looking at the synergy with Card B on Card A’s card page, the value will differ from the synergy value for Card A on Card B’s page.

This may not be intuitive, as it's unclear what it would mean if A were more synergistic with B than B with A.

Lift scores are symmetric, so the lift score for Card A on Card B’s page will be the same as the lift score for Card B on Card A’s page. 

Card-To-Card Scores

The primary motivation for replacing synergy came from problematic synergy scores between card pairings that include ubiquitous cards – those played in >50% of candidate decks which consist of all basic lands, Swords to PlowsharesSwords to Plowshares, Arcane SignetArcane Signet, Sol RingSol Ring, and Command TowerCommand Tower.

Arcane Signet
Sol Ring
Command Tower

From the following graph we can see that when the main card – the card page being looked at – is ubiquitous, it has strong negative synergy with almost every card.

When the card played with – the card on the main card’s page – is ubiquitous, the synergy is almost always strongly positive. 

Four histograms showing synergy score distributions under different conditions: both cards ubiquitous, main card ubiquitous, card played-with ubiquitous, and neither card ubiquitous. Each panel shows how synergy values cluster differently depending on card ubiquity

Lift removes this confusing phenomena, resulting in lift scores that are close to 1 when either card is ubiquitous, indicating no strong relationships between ubiquitous cards and other cards.

Four histograms showing lift score distributions for the cases where both cards are ubiquitous, the main card is ubiquitous, the played-with card is ubiquitous, and neither card is ubiquitous. Each panel highlights how lift values cluster under different ubiquity conditions.

You may have noticed that lift scores are centered around a value slightly greater than 1. Specifically, the median lift score across all considered card pairs is 1.58.

While a lift score this close enough to 1 essentially indicates a random pairing, I still believe this deserves an explanation.

While not yet proven, I do believe that the lift scores skew slightly above 1 on average because of the lack of true randomness between cards in the Commander format – the constraints around the color of the commander, the rules that every deck must contain 100 cards, and all non-lands must be singletons, etc.

However, to say definitively that this is the reason for lift scores skewing slightly higher than expected would require further investigation. 

Below we can see the relationship between lift and synergy for card-to-card pairings. Once again we see the “correction” made by lift towards values near 1 from what were more extreme synergy values when one of the cards was ubiquitous.

Note that values are capped at 100, as values with lift scores higher than this tend to be based on uncommon and largely irrelevant pairings. 

Scatterplot comparing lift scores (log scale) and synergy scores for many card pairs. Points are colored by ubiquity category: both cards ubiquitous, main card ubiquitous, played-with card ubiquitous, and neither card ubiquitous. Vertical and horizontal reference lines mark synergy = 0 and lift = 1.

Commander-To-Card Scores

While we would like to replace synergy with lift for commander pages as well as card pages, there are two main reasons it hasn't been done yet:

  1. Commander pages are significantly more complex because of the many filters (bracket, budget, tags). We're working on the backend to optimize this process to allow for easier calculations of lift scores across all filter combinations, but it's a work in progress.
  2. Commander-card synergy is not as problematic as card-card synergy. As you can see from the scatterplot below of synergy versus lift (for commander-card pairs that appear in at least five decks), they're generally in agreement at least in terms of directionality. In other words, when synergy is positive, lift is almost always greater than 1, and when synergy is negative, lift is almost always less than 1.

Scatterplot showing the relationship between lift scores (log scale) and synergy scores for commander–card pairs. Points form dense clouds around synergy near zero and lift near one, with higher lift values appearing mostly for positive synergy. Vertical and horizontal reference lines mark synergy = 0 and lift = 1

How To Interpret Lift Scores When Deckbuilding

While lift scores are an improvement over synergy scores, it is important to recognize that any metrics based on user provided deck information aren't perfect.

Most decks used in the calculation of these metrics aren't built optimally, and such suboptimal decks will weaken the quality of these metrics.

That being said, lift scores represent average trends among deckbuilders, so it's safe to assume that significant lift scores are indicative of actual synergistic behavior (or lack thereof) between two cards. 

As with any metrics on EDHREC, they're both based on user behavior as well as impact user behavior. Therefore, it's likely that two cards with high lift scores may end up being played together even more frequently and therefore result in even higher lift scores over time.

This could be an interesting analysis for the future, and we welcome any feedback in the meantime! 

Julia Maddalena

Julia Maddalena


As EDHREC's designated Duchess of Data, Julia is new to Magic but no stranger to finding interesting patterns in complex data. With her master's degree in statistics and extensive data science experience, she is the point person for digging into EDHREC's rich collection of deck data. Her deep dive into card popularity over time within each commander led to the advent of the Fire and Ice article series, a weekly series cowritten with EDHREC's seasoned editorial staff.

Want more Commander content, right in your inbox?
To stay on top of all our news, features, and deck techs, sign up for our EDHRECap e-mail newsletter.

EDHREC Code of Conduct

Your opinions are welcome. We love hearing what you think about Magic! We ask that you are always respectful when commenting. Please keep in mind how your comments could be interpreted by others. Personal attacks on our writers or other commenters will not be tolerated. Your comments may be removed if your language could be interpreted as aggressive or disrespectful. You may also be banned from writing further comments.