LoslegenKostenlos loslegen

SMOTE

When using SMOTE to over-sample the class of fraud cases, you have to decide on the number of nearest neighbors that are taken into account and how many synthetic fraud cases to create. The following exercises will guide you in using SMOTE.

The dataset creditcard and the libraries smotefamily and ggplot2 are already loaded in your workspace. Remember that the dup_size parameter answers the question how many times SMOTE should loop through the existing, real fraud cases.

Diese Übung ist Teil des Kurses

Fraud Detection in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Set the number of fraud and legitimate cases, and the desired percentage of legitimate cases
n0 <- ___; n1 <- ___; r0 <- ___
Code bearbeiten und ausführen