1.0 - 8.00 - Shapley Value Functions Example 2 Step 4 - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
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;

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
... ... ... ... ... ...