LoslegenKostenlos loslegen

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

Kurs anzeigen

Anleitung zur Übung

  • Plot network net and print account_info which contains information about the accounts (i.e. nodes).
  • Add features degree, closeness and betweenness to data frame account_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(___)
Code bearbeiten und ausführen