1.1 - 8.10 - Shapley Value Functions Example: nPath Creates ShapleyGenerateCombination; Step 4 - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

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;
SELECT * FROM attrib_acvs ORDER BY comb1,comb2;
 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
 1 2 4   1 2 4 5   5         3                1.0       4
 1 2 4 5 1 2 3 4 5 3         4                1.0       1
 1 2 5   1 2 3 5   3         3  0.800000011920929       4
 1 2 5   1 2 4 5   4         3  0.800000011920929       4
 1 3     1 2 3     2         2                1.0       6
 1 3     1 3 4     4         2                1.0       6
 1 3     1 3 5     5         2                1.0       6
 1 3 4   1 2 3 4   2         3                1.0       4
 1 3 4   1 3 4 5   5         3                1.0       4
 1 3 4 5 1 2 3 4 5 2         4                1.0       1
 1 3 5   1 2 3 5   2         3 0.4000000059604645       4
 1 3 5   1 3 4 5   4         3 0.4000000059604645       4
 1 4     1 2 4     2         2 0.8999999761581421       6
 1 4     1 3 4     3         2 0.8999999761581421       6
 1 4     1 4 5     5         2 0.8999999761581421       6
 1 4 5   1 2 4 5   2         3  0.699999988079071       4
 1 4 5   1 3 4 5   3         3  0.699999988079071       4
 1 5     1 2 5     2         2 0.8999999761581421       6
 1 5     1 3 5     3         2 0.8999999761581421       6
 1 5     1 4 5     4         2 0.8999999761581421       6
 2       1 2       1         1 0.8999999761581421       4
 2       2 3       3         1 0.8999999761581421       4
 2       2 4       4         1 0.8999999761581421       4
 2       2 5       5         1 0.8999999761581421       4
 2 3     1 2 3     1         2 0.8999999761581421       6
 2 3     2 3 4     4         2 0.8999999761581421       6
 2 3     2 3 5     5         2 0.8999999761581421       6
 2 3 4   1 2 3 4   1         3 0.8999999761581421       4
 2 3 4   2 3 4 5   5         3 0.8999999761581421       4
 2 3 4 5 1 2 3 4 5 1         4 0.6000000238418579       1
 2 3 5   1 2 3 5   1         3                1.0       4
 2 3 5   2 3 4 5   4         3                1.0       4
 2 4     1 2 4     1         2  0.800000011920929       6
 2 4     2 3 4     3         2  0.800000011920929       6
 2 4     2 4 5     5         2  0.800000011920929       6
 2 4 5   1 2 4 5   1         3  0.800000011920929       4
 2 4 5   2 3 4 5   3         3  0.800000011920929       4
 2 5     1 2 5     1         2  0.800000011920929       6
 2 5     2 3 5     3         2  0.800000011920929       6
 2 5     2 4 5     4         2  0.800000011920929       6
 3       1 3       1         1 0.8999999761581421       4
 3       2 3       2         1 0.8999999761581421       4
 3       3 4       4         1 0.8999999761581421       4
 3       3 5       5         1 0.8999999761581421       4
 3 4     1 3 4     1         2 0.8999999761581421       6
 3 4     2 3 4     2         2 0.8999999761581421       6
 3 4     3 4 5     5         2 0.8999999761581421       6
 3 4 5   1 3 4 5   1         3                1.0       4
 3 4 5   2 3 4 5   2         3                1.0       4
 3 5     1 3 5     1         2  0.800000011920929       6
 3 5     2 3 5     2         2  0.800000011920929       6
 3 5     3 4 5     4         2  0.800000011920929       6
 4       1 4       1         1 0.8999999761581421       4
 4       2 4       2         1 0.8999999761581421       4
 4       3 4       3         1 0.8999999761581421       4
 4       4 5       5         1 0.8999999761581421       4
 4 5     1 4 5     1         2  0.800000011920929       6
 4 5     2 4 5     2         2  0.800000011920929       6
 4 5     3 4 5     3         2  0.800000011920929       6
 5       1 5       1         1 0.8999999761581421       4
 5       2 5       2         1 0.8999999761581421       4
 5       3 5       3         1 0.8999999761581421       4
 5       4 5       4         1 0.8999999761581421       4