Closeness Example 3: Weighted, Bounded Graph, MaxDistance=8 - 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™

Input

Input tables are from AllPairsShortestPath Example 1: Unweighted, Unbounded Graph:

  • vertices: callers
  • edges: calls

SQL Call

SELECT * FROM Closeness (
  ON callers AS vertices PARTITION BY callerid
  ON calls AS edges PARTITION BY callerfrom
  USING
  TargetKey ('callerto')
  EdgeWeight ('calls')
  MaxDistance (8)
  Accumulate ('callerid', 'callername')
) AS dt ORDER BY callerid;

Output

callerid callername inv_sum_dist inv_avg_dist sum_inv_dist kdegree
1 John 0.1 0.3 1.03333333333333 3
2 Carla 0.142857142857143 0.142857142857143 0.142857142857143 1
3 Simon 1 1 1 1
4 Celine 0.25 0.25 0.25 1
5 Winston       0
6 Diana       0