Shapley Value regression (Game Theory) as an Attribution solution

Shapley Value regression (referred to commonly as Game Theory) is at its core quite an elegant solution, and one I’ve left until quite late on in the series to post about as it is an approach I haven’t implemented, despite understanding its principles.

[ I therefore offer no real practicable insight, short of that from discussions with 3rd party practitioners and published papers. ]

 

At the core of this algorithm sits a fairly simple two stage approach

1              Identify a baseline ‘importance’ value for each campaign that represents the expected conversion performance (number of conversions, or anticipated conversion rate)

2              Run a series of regressions comparing the importance value of each campaign in turn with each of the others as a pair, triplet, or higher order combination. Allocate the conversions observed when these combinations occur in the attribution data based on the Shapley Value regression approach

 

In essence, the approach simulates a series of multivariate (A/B) test uplift comparisons. I first came across this approach when assisting in pilot testing with GoogleNY shortly after their acquisition of Adometry. At the time I little understood the approach, focusing more on the credibility of the attributed outputs.

I came across it again when research uncovered the Shao and Li paper “Data-driven Multi-touch Attribution Models”, which details a 2nd order Shapley regression almost as an aside to their ensemble logistic regression approach (the latter of which, frustratingly, I cannot get to produce valid results using our data!).

A more comprehensive step by step detailing of the technique is incorporated in to the Abakus patent (http://www.google.co.uk/patents/US8775248). Incidentally, Abakus provide a series of short videos on their site explaining how the technique is applied, though the algorithm (as far as I could see) isn’t covered.

 

Hence, a simplified example of how stage 1 and 2 are executed (as I understand it). Note that the below approach is based upon the Abakus method described in their patent, but other methods for determining the stage 1 ‘player values’ are alluded to, if not detailed, in other articles (http://huayin.wordpress.com/tag/attribution-modeling/)  such as logistic regression, time-decay based models, etc.

 

Imagine this core result set obtained from a hypothetical attribution data set:

S1 S2 S3 Desc Unique Users Conversions cr%
PPC Brand p1 800 60 7.500%
SEO p2 850 45 5.294%
Display p3 150000 10 0.007%
PPC Brand SEO p1,2 300 25 8.333%
PPC Brand Display p1,3 1800 65 3.611%
SEO Display p2,3 1900 55 2.895%
PPC Brand SEO Display p1,2,3 700 40 5.714%
P p0 3000000 100 0.003%

 

 

From this aggregated data set, we ascertain each campaigns ‘playing value’ – i.e. stage 1 above. Starting with PPC Brand, we multiply its conversion rate in isolation (7.5%) against all the combinations in which it appears (800+300+1800+700) and add to that the rate that would occur anyway (the baseline of 0.003% against 850+150000+1900+3000000). This gives a playing value for V1  (PPC Brand only) of 375. This is repeated for each of the single campaign only combinations (V2 and V3).

For the two-campaign sets, the channels base conversion rate is applied against the combinations it occurs in but which the OTHER campaign does not, PLUS how it performs together. So for PPC+SEO, then this set (V1,V2) is worth =

7.5% * (800+1800)                           (the PPC component of the set)

+ 5.294% * (850+1900)                   (the SEO component of the set)

+8.333% * (300+700)                      (the combined PPC+SEO components)

+0.003% * (150000+3000000)      (the baseline * what’s left)

= 529

 

The last remaining combination of all sets (V1,V2,V3) is effectively the ‘game’ total – a sum of all conversions (400).  Then we account for the base line set, V0 (no media) which is 105 (0.0003% * all users).

This yields a ‘game’ as follows against which we enter each ‘campaign value’ in the order seen (starting with the special value, V0 = 105). On adding each subsequent set, we evaluate the ‘incremental’ difference.

E.g. in the first combination, PPC Brand, we know its V1 score is 375. Therefore after V0 has claimed 105, only 270 is left.

In the second combination, PPC Brand+SEO, we apply 105, then 270, then 529-270-105 = 154

And so on as follows:

 

Marginal Improvement Values
Step 1 Step 2 Step 3 V0 (Base) PPC Brand SEO Display
PPC Brand 105 270
PPC Brand SEO 105 270 154
PPC Brand Display 105 270 -92
PPC Brand SEO Display 105 270 154 -129
PPC Brand Display SEO 105 270 117 -92
SEO 105 198
SEO PPC Brand 105 225 198
SEO Display 105 198 -57
SEO PPC Brand Display 105 225 198 -129
SEO Display PPC Brand 105 154 198 -57
Display 105 5
Display PPC Brand 105 173 5
Display SEO 105 136 5
Display PPC Brand SEO 105 173 117 5
Display SEO PPC Brand 105 154 136 5
Attribution: 105 223 164 5
Target is 400 conversions: 105 167.7 123.5 3.9

 

The attribution score is the average contribution of the column which typically may exceed the actual number of conversions, and hence is scaled to a target number of conversions.

 

The occurrence of negative values occurs because while the model is based on cooperative game theory (that is, the worth from a combination of participants’ activity cannot be worse than the best ‘player’ alone) in reality two channels occurring together may well have a conversion rate LESS than the parts achieve “independently”. This effect is observed in the Anderl et al. result set (http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2343077). Does this mean that a channel has a negative effect? Likely, no. It’s much as we observe in logistic regression where the likelihood is that two different customer states are being pooled.

 

Hence we again turn to data pre-processing, whereupon I can offer no real practical advice short of that recommended in the Abakus patent and elsewhere (such as Archak et al., “Mining Advertiser-specific User Behaviour Using Adfactors): pre and post site visit segmentation of data. The logic behind this is to ascertain the clicks that are most likely ‘navigational’ in nature, and thus push credit the other side of this divide in to ‘influencing’ activity.

In addition, a proportion is extracted from the influencing bracket and allocated to a baseline of non-digital media conversions. I am admittedly unclear how these proportions are decided given the exact number of non-converting, non-exposed users is not directly measurable, but trust that an estimate of cookies in market can at least give a steer. I imagine also a calibration of the outputs is enacted in order to bring the results in line with those expected (again from independent tests).

 

So in summary – the game theory as an approach isn’t overly complex. The difficulty though is the efficient reduction of the data in to distinct sets, and then the stepwise allocation of ‘values’ as seen in stage 1. Stage 2 as it happens has been solved in a variety of packages in R and is freely available (and is quick to execute).

 

If you’ve access to GA Premium, then ultimately it is a version of this approach that is deployed in the Data-Driven Algorithm available under the attribution section. It’s not easy though to determine what data manipulation has been employed (if any?) given that the algorithm is locked up in a black box click-and-go.

Even so, I find the results interesting if only for the ability to see the ‘direct conversion’ land grab. Display campaigns increase against a last click view of the world, but maybe not quite so much as we see in say the Markov approach. In addition, some non-brand PPC terms also seem to increase – the opposite from that seen in other approaches I’ve tried. This might be via collection from the direct conversion pool, but either way, it is always interesting to have another model, especially one requiring little effort from the user.

__

Note for reference: An independent comparison of results is available in the aforementioned Anderl paper and is well worth a read given the differences observed between models.

Advertisements

4 thoughts on “Shapley Value regression (Game Theory) as an Attribution solution

  1. Hi! Thank you for your great post! It really made some things clear to me.
    You say that step two of the Shapley value regression is implemented in a variety of packages in R. Could you tell me which packages these are?
    Thanks a lot for your help!

    Like

  2. Jonathan,

    Love your articles, but I’m a bit confused on certain parts of this one; in particular, the statement:
    “Run a series of regressions comparing the importance value of each campaign in turn with each of the others as a pair, triplet, or higher order combination. Allocate the conversions observed when these combinations occur in the attribution data based on the Shapley Value regression approach”

    Where are these regressions actually happening in the example? It just seems like straightforward math…

    Like

    1. I’ve always taken the regression to be the calculation of the average over all orderings of ‘players’ – i.e. the last table here. As to whether it’s straightforward maths; I guess that depends on your experience, but sure, it’s fairly accessible I’d say.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s