Session Ready
Exercise

Model comparison warmup

In this exercise, you will run a basic comparison of the four categories of outcomes between MLPs and Random Forests using a confusion matrix. This is in preparation for an analysis of all the models we have covered. Doing this warm-up exercise will allow you to compare and contrast the implementation of these models and their evaluation for CTR prediction.

In the workspace, we have training and testing splits for X and y as X_train, X_test for X and y_train, y_test for y respectively. Remember, X contains our engineered features with user, device, and site details whereas y contains the target (whether the ad was clicked). X has already been scaled using a StandardScaler(). For future ad CTR prediction models, the setup will be analogous.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Create a Random Forest model, and a MLP model with one hidden layer (using hidden_layer_sizes) of 10 units, and 40 max iterations (using max_iter).
  • Look at the four category of outcomes via confusion_matrix(y_test, y_pred) to compare them.