# Shapley Value Functions Example 1 Input - Teradata Vantage

## Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Release Number
1.0
8.00
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
lmf1502735330121
Product Category

The input table, project_cost, has data for three projects (players). The player position is represented by the three digits shown in the column project_index. The first digit corresponds to project1, the second digit to project2, and so on. The digit 1 indicates that the project is included; 0 indicates that it is excluded. The column projects_combined also indicates which projects are included.

project_cost
serialnum projects_combined project_index capital_cost operating_cost total_cost
1 p_1 100 0 3000 3000
2 p_2 010 10000 3000 13000
3 p_3 001 10000 0 10000
4 p_12 110 10000 4000 14000
5 p_13 101 10000 3000 13000
6 p_23 011 16000 3000 19000
7 p_123 111 16000 4000 20000

Assume that you implemented all three projects and want to know the average contribution of each project to the total cost (capital_cost + operating_cost). Shapley value calculates that average cost contribution over all possible orderings of the players.

Given a cost-sharing game, let the players join the game one at a time in predetermined order. The cost contribution of a player is the net addition to cost when the player joins (that is, the incremental cost of adding the player to the group of players who have already joined).

The last line in the preceding table that includes all the projects (p_123) is analyzed as follows to derive the average contribution.

## Sharing the Capital Cost of 16,000 for p_123

• Player p_1 adds nothing to any coalition and pays nothing.
• Players p_ 2 and p_ 3 are symmetric and pay equally.
• The players share the 16,000 capital cost as follows:
Player Cost
p_1 0
p_2 8,000
p_3 8,000

## Sharing Operation Cost of 4,000 for p_123

• Player p_3 adds nothing to any coalition and pays nothing.
• Players p_ 1 and p_ 2 are symmetric and pay equally.
• The players share the 4,000 capital cost as follows:
Player Cost
p_1 2,000
p_2 2,000
p_3 0

## Sharing Total Cost of 20,000 for p_123

• Player p_1 pays 0+2000=2000.
• Player p_2 pays 8000+2000=10,000.
• Player p_3 pays 8000+0=8000.

The preceding values are the Shapley values of the projects, which are also shown in the Shapley Value Functions Example 1 Step 3 output.