Modularity Example 2: Weighted Edges and Community Edge Table - 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™

Followers follow leaders with different intensity.

SQL Call

SELECT * FROM Modularity (
  ON friends AS vertices PARTITION BY friends_name
  ON followers_leaders AS edges PARTITION BY follower
  OUT TABLE CommunityEdgeTable (community_edges)
  USING
  TargetKey ('leader')
  Directed ('true')
  CommunityAssociation ('group_id')
  EdgeWeight ('intensity')
  Accumulate ('friends_name', 'location')
) AS dt ORDER BY friends_name;

Output

Community Vertex Table
friends_name location resolution community_id num_communities modularity_score
Alex SanFrancisco 1 LosAngeles 2 0.442684
Bob LosAngeles 1 LosAngeles 2 0.442684
Casey LosAngeles 1 LosAngeles 2 0.442684
Danny NewYorkCity 1 Birmingham 2 0.442684
Eve Birmingham 1 Birmingham 2 0.442684
Fox Austin 1 Birmingham 2 0.442684
Gohar Miami 1 LosAngeles 2 0.442684
Harry Chicago 1 LosAngeles 2 0.442684
Community Edge Table community_edges
src_community_id target_community_id resolution weight
LosAngeles LosAngeles 1 52
LosAngeles Birmingham 1 3
Birmingham LosAngeles 1 3
Birmingham Birmingham 1 48