Shapley Values Concept

Marc Deveaux
4 min readAug 17, 2022

--

Photo by Thierry Meier on Unsplash

Source

What are Shapley Values?

  • Game theory is the branch of mathematics studying how and why people make decisions (Specifically, it is “the study of mathematical models of conflict and cooperation between intelligent rational decision-makers”; source: Wikipedia). A famous example of game theory is the prisoner’s dilemma
  • The Shapley value is a solution concept used in game theory that involves fairly distributing both gains and costs to several actors working in coalition. Basically, “the Shapley value is the average expected marginal contribution of one player after all possible combinations have been considered”
  • For example, you can use Shapley Values to measure each players’ importance in a basketball’s team. To do this, we would check the average marginal contribution across every possible sequence in which the players could have been added to the team

Shapley Values application example

“Shapley values help with marketing analytics. A company selling their product on their website will likely have different touchpoints, which are ways for customers to engage with the company and drive them to ultimately buy their product. For example, a company might have various marketing channels to attract potential customers, such as social media, paid advertising, and email marketing campaigns. The Shapley value can be applied here, assigning each marketing channel as “players,” with the “payoff” being the purchase of the product. By assigning values to each channel, Shapley value analysis can help determine what channels get the credit for the online purchase.”

Step by step process

Let’s say that Amy, Bob and Claire share a taxi to come back to their respective homes which are all on the same way / direction:

  • it costs Amy 6 pounds to get home
  • it costs Bob 12 pounds to get home
  • it costs Claire 42 pounds to get home

Framework and characteristics

In a cooperative game you need players and coalitions that we define as :

  • each group of players is called a coalition and the coalition of all players is called the grand coalition. For example, a coalition could be Amy and Bob catching the taxi by themselves
  • recall that ⊆ means subset as in {7, 15} ⊆ {7, 13, 15, 21}
  • each coalition is matched to a real number. For example, if Amy takes the taxi by herself, the fare will be 6 pounds. If Bob and Claire take a taxi together, the value of the coalition will be 42 pounds

Fair distribution

In order to be fair with everybody, we need to respect the following conditions:

  1. Efficiency: all the gains from cooperation are distributed among the players — none is wasted.
  2. Null player: a player that makes zero marginal contribution to the gains from cooperation receives zero payoff
  3. Symmetry: players that make equal contributions receive equal payoffs
  4. Additivity: the game cannot be divided into a set of smaller games that together achieve greater total gains

It has been shown that there is only one way to distribute the values in order to respect those conditions and that is the Shapley Value

Shapley Value

Given a characteristic function game val (previously labelled as G), the Shapley value of a player j is given by:

  • Shapley value is a distribution
  • the right part represent the difference between value achieved by sub team and the realized value when a player j is added

Calculating the contributions

We can calculate all the different taxi prices based on A,B and C subsets:

Shapley Value Calculation

  • Shapley value is found by averaging each column
  • 2, 5 and 35 sum up to 42 and represent the fairest way to share the Taxi fare

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Marc Deveaux
Marc Deveaux

No responses yet

Write a response