Motivating example: uncovering social groups

4.1. Motivating example: uncovering social groups#

In this chapter, we analyze datasets in the form of networks. As motivation, we first look at the Karate Club dataset.

From Wikipedia:

A social network of a karate club was studied by Wayne W. Zachary for a period of three years from 1970 to 1972. The network captures 34 members of a karate club, documenting links between pairs of members who interacted outside the club. During the study a conflict arose between the administrator “John A” and instructor “Mr. Hi” (pseudonyms), which led to the split of the club into two. Half of the members formed a new club around Mr. Hi; members from the other part found a new instructor or gave up karate. Based on collected data Zachary correctly assigned all but one member of the club to the groups they actually joined after the split.

Figure: Karate Club network (Source)

Karate club network

\(\bowtie\)

We use the NetworkX package to load the data and vizualize it. We will say more about it later in this chapter. In the meantime, there is a good tutorial here.

import networkx as nx
G = nx.karate_club_graph()
nx.draw_networkx(G)
../../_images/649ec2cdad4b08a0de7d92bd40e0cf1fb238b28cc5a4c15fbd6c2e3112d0b913.png

Our goal:

identify natural sub-groups in the network

That is, we want to find groups of nodes that have many links between them, but relatively few with the other nodes.

It will turn out that the eigenvectors of the Laplacian matrix, a matrix naturally associated to the graph, contain useful information about such communities.