Shapley Value Functions Example: ShapleyGenerateCombination, ShapleyAddOnePlayer; Step 1 - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Step 1 creates payoff tables for each combination.

Different combinations of projects are created using the ShapleyGenerateCombination function on Shapley Value Functions Example: ShapleyGenerateCombination, ShapleyAddOnePlayer; Input. The value column indicates the total cost (sum of capital cost and operating_cost) as specified in the SQL call.

SQL Call

CREATE MULTISET TABLE project_comb_cost AS (
  SELECT * FROM ShapleyGenerateCombination (
    ON (SELECT project_index, total_cost AS value_sh FROM project_cost)
  )AS dt 
) WITH DATA;

Output

SELECT * FROM project_comb_cost;
 comb  size value   
 ----- ---- ------- 
 1 2      2 14000.0
 2 3      2 19000.0
 2        1 13000.0
 3        1 10000.0
 1        1  3000.0
 1 2 3    3 20000.0
 1 3      2 13000.0