Aan de slagGa gratis aan de slag

Visualizing patterns in the data

The first step before you start modeling is to explore your data. Let's start by examining your dataset and visualizing different patterns between fraudulent and regular samples. Exceptionally, you're going to build the visualization!

The dataset transfers contains credit transfers and some of them were recorded as fraud. The column fraud_flag indicates whether the transaction is fraudulent (fraud_flag = 1) or not (fraud_flag = 0). This dataset and the ggplot2 package are loaded in your workspace.

Deze oefening maakt deel uit van de cursus

Fraud Detection in R

Cursus bekijken

Oefeninstructies

  • Plot the column amount as the independent variable on the x axis, and the column orig_balance_before, which is the balance on the originator's account before booking the transfer, as the dependent variable on the y axis.
  • Color and shape the data based on the value in the fraud_flag column.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Make a scatter plot
ggplot(transfers, aes(x = ___, y = ___)) +
  geom_point(aes(color = ___, shape = ___)) +
  scale_color_manual(values = c('dodgerblue', 'red'))
Code bewerken en uitvoeren