How can I get interaction assessment for gbm calculated with fixed n.trees? I tried:
data(Anguilla_train)
angaus.fixed <- gbm.fixed(data=Anguilla_train, gbm.x = 3:13,
gbm.y = 2,family = "bernoulli", tree.complexity = 5, learning.rate = 0.01,
bag.fraction = 0.5, n.trees = 5000)
find.int <- gbm.interactions(angaus.fixed)
But:
1 Error in
[.data.frame(pred.frame, , n) : undefined columns selected
After a careful examination of the
dismo::gbm.interactionsfunction, I found thatdismo::gbm.fixedreturns an object that is not fully compatible withgbm.interactions.Here is how your code could be modified:
Now
gbm.interactionsworks nicely and yields the following results: