Shapley Value Functions Example 2 Step 4 - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Step 4 computes the augmented characteristic value table (ACVS).

CREATE MULTISET TABLE attrib_acvs AS (
  SELECT * FROM ShapleyAddOnePlayer (
    ON attrib_cvs
    USING
    CombinationColumn ('comb')
    SizeColumn ('size')
    ValueColumn ('value')
    NumPlayers (5)
  ) AS dt 
) WITH DATA;

This query returns the following table:

SELECT * FROM attrib_acvs ORDER BY comb1,comb2;
attrib_acvs
comb1 comb2 player size value divisor
NULL 1 1 0 0.0 1
NULL 2 2 0 0.0 1
NULL 3 3 0 0.0 1
NULL 4 4 0 0.0 1
NULL 5 5 0 0.0 1
1 1 2 2 1 0.800000011920929 4
1 1 3 3 1 0.800000011920929 4
1 1 4 4 1 0.800000011920929 4
1 1 5 5 1 0.800000011920929 4
1 2 1 2 3 3 2 0.800000011920929 6
1 2 1 2 4 4 2 0.800000011920929 6
1 2 1 2 5 5 2 0.800000011920929 6
1 2 3 1 2 3 4 4 3 0.699999988079071 4
1 2 3 1 2 3 5 5 3 0.699999988079071 4
1 2 3 4 1 2 3 4 5 5 4 0.8999999761581421 1
1 2 3 5 1 2 3 4 5 4 4 0.800000011920929 1
1 2 4 1 2 3 4 3 3 1.0 4
... ... ... ... ... ...