Adding network features
Enriching data with network features and other kinds of variables improves a model's ability to detect fraud.
The network net
is based on the transactional dataset transfers
from different accounts. The data account_info
contains details on these accounts which are the nodes of the network. You can add network features to account_info
like degree
, closeness
and betweenness
.
Diese Übung ist Teil des Kurses
Fraud Detection in R
Anleitung zur Übung
- Plot network
net
and printaccount_info
which contains information about the accounts (i.e. nodes). - Add features
degree
,closeness
andbetweenness
to data frameaccount_info
as the normalized degree, closeness and betweenness respectively. - Show the new features of the accounts (i.e. nodes) by printing
account_info
.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Plot network and print account info
___
legend("bottomleft", legend = c("known money mule", "legit account"), fill = c("darkorange", "lightblue"), bty = "n")
print(___)
# Degree
account_info$___ <- ___(___, normalized = ___)
# Closeness
account_info$___ <- ___(___, ___ = ___)
# Betweenness
account_info$___ <- ___(___, ___ = ___)
print(___)