CommencerCommencer gratuitement

Build your own detection model

Let's combine the tools we've seen in this chapter. The credit transfer dataset from the previous exercises was split in a training set and a test set with the same class imbalance. Next, SMOTE was applied on the training set. You'll build a classification tree model on both the original imbalanced training set and the re-balanced training set. Finally, both models will be compared on the same test set.

The rpart and caret libraries are already loaded in your workspace. Don't hesitate to refer to the slides to complete this exercise.

Cet exercice fait partie du cours

Fraud Detection in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Train the rpart algorithm on the original training set and the SMOTE-rebalanced training set
model_orig <- ___(___, data = ___)
model_smote <- ___(___, data = ___)
Modifier et exécuter le code