Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Machine Learning by (19k points)

The reference manual for the gbm package states the interact.gbm function computes Friedman's H-statistic to assess the strength of variable interactions. the H-statistic is on the scale of [0-1].

The reference manual for the dismo package does not reference any literature for how the gbm.interactions function detects and models interactions. Instead it gives a list of general procedures used to detect and model interactions. The dismo vignette "Boosted Regression Trees for ecological modeling" states that the dismo package extends functions in the gbm package.


How does dismo::gbm.interactions actually detect and model interactions?

I am asking this question because gbm.interactions in the dismo package yields results >1, which the gbm package reference manual says is not possible.

I checked the tar.gz for each of the packages to see if the source code was similar. It is different enough that I cannot determine if these two packages are using the same method to detect and model interactions.

1 Answer

0 votes
by (33.1k points)

Simply use the dismo package, because we can also obtain the relevant source code for gbm.interactions. The interaction test boils down to the following commands:

For example:

interaction.test.model <- lm(prediction ~ as.factor(pred.frame[,1]) + as.factor(pred.frame[,2]))

interaction.flag <- round(mean(resid(interaction.test.model)^2) * 1000,2)

pred.frame contains a grid of the two predictors in question, and prediction is the prediction from the original gbm fitted model where all but two predictors under consideration are set at their means.

Hope this answer helps you! To know more about Gbm, study the Machine Learning Tutorials and go through the Machine Learning Online Course.

Browse Categories