LocalClusteringCoefficient Example 2: WUN with DegreeRange 3 or Greater - 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™

This example treats the input graph as a weighted, undirected network and outputs only nodes with degree range 3 or greater.

Input

Input tables are from LocalClusteringCoefficient Example 1: WUN:

  • edges: trade
  • vertices: country

SQL Call

SELECT * FROM LocalClusteringCoefficient (
  ON trade AS edges PARTITION BY fromid
  ON country AS vertices PARTITION BY countryid
  USING
  TargetKey ('toid')
  Directed ('f')
  EdgeWeight ('tradeweight')
  DegreeRange ('[3:]') 
  Accumulate ('countryid', 'name')
) AS dt ORDER BY countryid;

Output

countryid name degree tri_cnt cc w_cc
1 USA 4 6 1.00000 0.44642
3 UK 4 6 1.00000 0.44642