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:

Don’t forget to load any necessary package(s).