I don't understand how the gbm's parameter "bag.fraction" works. For me, gradient boosting works globally like that :
- Fit a tree f_hat_b with d splits to the training data (X, r) (where r_i=y_i for the 1st step).
- Update f_hat by adding in a shrunken version of the new tree : f_hat <- f_hat + lambda*f_hat_b(x)
- Fit a tree with d splits to the training data (X,r) where r <- r - lambda*f_hat_b(x).
and repeat these 3 actions B times.
So, for me, if we have N observations, we would have N residuals at the second step. Does bag.fraction=p means that we will fit only p*N residuals ? And with what observations ?
Also, as I'm interested in having interactions between predictors, I would like to use interact.gbm. Do I have to do before a gbm with interaction.depth > 1 (strictly !) ?
Thank you !