1.0 - 8.00 - Modularity Example 2: Weighted Edges and Community Edge Table - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

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