We keep using the Hitters data set from the previous exercise, we also use the same test and train set.
We now apply bagging to the training set (using 500 trees and a seed value of 1).
Store the test set MSE for this approach in mse.bag.
Assume that:
Hitters, Hitters.train and Hitters.test data frames are loaded.log will be calculated twice resulting in an incorrect submission.Don’t forget to load any necessary package(s).