Social network metrics

Fraud Detection in R

Tim Verdonck

Professor Data Science at KU Leuven

Geodesic

Shortest path between nodes, e.g. between A and I

shortest_paths(network, from = "A", to = "I")
A C G I

geodesic_v2.png

Fraud Detection in R

Degree = number of edges

degree(network)
A 
2 

toy_graph_02bis_nodeA.png

Fraud Detection in R

Degree = number of edges

degree(network)
A B
2 2

toy_graph_02bis_nodeB.png

Fraud Detection in R

Degree = number of edges

degree(network)
A B C
2 2 1

toy_graph_02bis_nodeC.png

Fraud Detection in R

Degree = number of edges

degree(network)
A B C D 
2 2 1 3 

If Network has $N$ nodes, then normalizing degree means dividing by $N-1$. Here divide by 3:

degree(network, normalized = TRUE)
      A       B       C       D
0.66667 0.66667 0.33333 1.00000

toy_graph_02bis_nodeD.png

Fraud Detection in R

Closeness

Inverse distance of a node to all other nodes in the network

closeness_blank.png

Fraud Detection in R

Closeness

Inverse distance of a node to all other nodes in the network

closeness(network)
   A
0.25

closeness_A.png

Fraud Detection in R

Closeness

Inverse distance of a node to all other nodes in the network

closeness(network)
   A    B
0.25 0.25

closeness_B.png

Fraud Detection in R

Closeness

Inverse distance of a node to all other nodes in the network

closeness(network)
   A    B    C
0.25 0.25 0.20

closeness_C.png

Fraud Detection in R

Closeness

Inverse distance of a node to all other nodes in the network

closeness(network)
   A    B    C    D 
0.25 0.25 0.20 0.33 

closeness_D.png

Fraud Detection in R

Closeness

Inverse distance of a node to all other nodes in the network

closeness(network)
   A    B    C    D 
0.25 0.25 0.20 0.33 
closeness(network, normalized = TRUE)
   A    B    C    D
0.75 0.75 0.60 1.00 

closeness_all.png

Fraud Detection in R

Betweenness

Number of times that a node or edge occurs in the geodesics of the network betweenness_blank.png

Fraud Detection in R

Betweenness

Number of times that a node or edge occurs in the geodesics of the network betweenness_A_E.png

betweenness(network)
A       E
0       0
Fraud Detection in R

Betweenness

Number of times that a node or edge occurs in the geodesics of the network betweenness_B.png

betweenness(network)
A B     E
0 3     0
Fraud Detection in R

Betweenness

Number of times that a node or edge occurs in the geodesics of the network betweenness_C.png

betweenness(network)
A B C   E
0 3 4   0
Fraud Detection in R

Betweenness

Number of times that a node or edge occurs in the geodesics of the network betweenness_D.png

betweenness(network)
A B C D E
0 3 4 3 0
Fraud Detection in R

Featurization

features2

Fraud Detection in R

Let's practice!

Fraud Detection in R

Preparing Video For Download...