EigenvectorCentrality Example: Eigenvector Centrality | Teradata Vantage - EigenvectorCentrality Example: Eigenvector Centrality - 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ā„¢

Input

In the following figure, nodes represent college sophomores and edges represent the number of elective subjects that both sophomores have taken.

EigenvectorCentrality Examples Input Graph
Graph of input for examples of Machine Learning Engine function EigenvectorCentrality

The graph in the figure is represented by the Vertices and Edges tables sophomores and common_classes, respectively.

Vertices: sophomores
id name
A Allen
B Becky
C Cathy
D Darren
Edges: common_classes
startid endid electives
A B 1
A C 1
B C 1
C D 1
D A 1

SQL Call

Family is 'eigenVector' by default.

SELECT * FROM EigenvectorCentrality (
  ON sophomores AS Vertices PARTITION BY id
  ON common_classes AS Edges PARTITION BY startid
  USING
  TargetKey ('endid')
  Accumulate ('id')
  EdgeWeight ('electives')
) AS dt ORDER BY centrality DESC;

Output

 id centrality          
 -- ------------------- 
 c   0.6494505502390958
 b  0.35224436623137406
 d   0.5283665493470611
 a  0.41829018489975667

Download a zip file of all examples and a SQL script file that creates their input tables.