LocalClusteringCoefficient Example | Teradata Vantage - LocalClusteringCoefficient Example: WUN, DegreeRange 3+ - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.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.