1.0 - 8.00 - Modularity Example 1: Unweighted Edges - 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 equal intensity (all edges have default weight 1).

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')
  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 3 0.425926
Bob LosAngeles 1 LosAngeles 3 0.425926
Casey LosAngeles 1 LosAngeles 3 0.425926
Danny NewYorkCity 1 Austin 3 0.425926
Eve Birmingham 1 Austin 3 0.425926
Fox Austin 1 Austin 3 0.425926
Gohar Miami 1 Chicago 3 0.425926
Harry Chicago 1 Chicago 3 0.425926