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

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