LocalClusteringCoefficient Example: WUN, DegreeRange 3+ - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.10
1.1
Published
October 2019
Language
English (United States)
Last Update
2019-12-31
dita:mapPath
ima1540829771750.ditamap
dita:ditavalPath
jsj1481748799576.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: 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 0.44642
         3 uk        4       6  1 0.44642

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.