I need to use the xgb.train function from the xgboost R package, and I was looking at the various parameters. Among those, subsample sounds like it could be used in place of splitting the dataset into a train and validation set (I am not 100% sure about this though, please if anybody can confirm I would be grateful).
Subsample ratio of the training instances. Setting it to 0.5 means that XGBoost would randomly sample half of the training data prior to growing trees. and this will prevent overfitting. Subsampling will occur once in every boosting iteration.
Now, I like that xgb.train has
the capacity to follow the progress of the learning after each round (source)
using the watchlist parameter. However, how am I suppose to follow the progress of the learning if I don't explicitly pass the validation set to the wathclist? Will just passing the data that I use as my data argument to the xgb.train function suffice if I am also defining subsample as 0.7?
To clarify, here is a code example:
my_mod <- xgb.train(
params = my_params,
data = my_data,
eval_metric = "rmse",
watchlist = list(train = my_data),
early_stopping_rounds = 100,
nrounds = 1000,
subsample=0.7)