Exercise

Relational neighbor classifier

A relation model is based on the idea that the behavior between nodes is correlated, meaning that connected nodes have a propensity to belong to the same class. The relational neighbor classifier, in particular, predicts a node's class based on its neighboring nodes and adjacent edges.

The dataset transfers consists of transactions from different accounts. The account_info data contains which of these accounts are money mules. However, it is unknown whether account "I41" is a money mule. Predict the money mule propensity of account "I41" using a relational neighbor classifier.

Instructions

100 XP
  • Create an undirected graph called net based on transfers. Set directed to the appropriate boolean (TRUE or FALSE).
  • Specify a color for each node: set V(net)$color to "darkorange" if account_info$isMoneyMule == TRUE and "slateblue1" otherwise.
  • Use subgraph() on net to create a subgraph called subset containing vertices "I41","I47", "I87" and "I20".
  • Use function strength() on subnet and on net to compute the money mule probability of node "I41" as the fraction of mule neighbors