Get startedGet started for free

Social network analytics

1. Social network analytics

In the previous chapter, you’ve learnt different techniques to discover fraudulent transactions such as circular histograms, recency and frequency. In this chapter, we will focus exclusively on using social networks for fraud detection. In this lesson we describe the basic social network components and various representations. Visual representation can be part of the preprocessing phase (familiarize user with the data and obtain first insights) or post processing phase (verify obtained results and understand rationale).

2. Social network components

A social network consists of both nodes and edges. Depending upon the business setting and application, the nodes or vertices can be customers, companies, products, credit cards, accounts, web pages, etc.

3. Social network components

The edges or links define the connection between the nodes. The edge definition depends upon the context you are working in, such as fraud, churn, email, etc. Edges can for example represent a money transfer, a call, a friendship, transmission of a disease or a reference.

4. Social network components

The edges can be weighted based upon interaction frequency, importance of information exchange, intimacy, emotional intensity, etc. The weights are usually positive values. Negative weights can be used to represent an animosity relationship, although this is very rare.

5. Social network components

The edges can also be directed to represent a flow of the relationship. Think for example about an incoming or outgoing call in a call network.

6. Social network representation

A first way to represent a social network is by using a sociogram. This is a visual representation of the network as you can see illustrated here. Our network has 4 nodes, A, B, C and D. The nodes can also be colored according to their status such as fraud or non-fraud. Sociograms are convenient for small networks or subsets of networks, but they are not feasible to represent large scale networks.

7. Social network representation

A second, more handy representation is a connectivity matrix. Here you can see the connectivity matrix for our example network. This is a square matrix with the nodes in the rows and columns. The cells represent the connections with 1 indicating a connection and 0 no connection. For undirected connections or edges, the matrix is symmetric. The connectivity matrix is often a matrix that contains many zeroes and only a few ones, also known as a sparse matrix.

8. Social network representation

An adjacency list is another way of representing the network by providing a list of all its connections. Here you can see the adjacency list for our network.

9. Social network representation

Both the connectivity matrix and the adjacency list can be extended to also take the weights of the network connections into account. Here you can see the weighted connectivity matrix and corresponding weighted adjacency list for our example network.

10. Towards a network

Social networks are usually constructed starting from a flat transactional data source as illustrated here. For each transaction, the data contains information about the originator, beneficiary, amount, time, beneficiary country and the payment channel. The data source can then be used to construct the network using the function graph_from_dataframe.

11. Plotting a network

Plotting the network results in the following sociogram.

12. A network's edges and nodes

From the network, we can then also extract the nodes and the edges using the commands E() and V(), respectively.

13. Overlapping edges

Multiple edges between two nodes in the network often indicate a stronger link between the nodes compared to a single edge. The function "count.multiple" counts the multiplicity of each edge in the network. We can make multiple edges overlap by setting the "width" or weight of the edge equal to its multiplicity.

14. Overlapping edges

For plotting the network with overlapping edges, we set the parameter "curved" for the edges equal to FALSE.

15. Let's practice!

Time to put this into practice.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.