Learn R Programming

treemisc (version 0.0.1)

gbm_2way: Two-way interactions

Description

Computes Friedman's H-statistic (Friedman & Popescu, 2008) for all pairwise interaction effects in a gbm model.

Usage

gbm_2way(object, data, var.names = object$var.names, n.trees = object$n.trees)

Value

A data frame with the following three columns:

var1

The name of the first feature.

var2

The name of the second feature.

h

The corresponding H-statistic.

The resulting rows are sorted in descending order of h.

Arguments

object

A gbm object.

data

Data frame containing the original training data (or representative sample thereof).

var.names

Character string specifying the predictor names to consider.

n.trees

Integer specifying the number of trees to use.

References

Friedman, J. H., & Popescu, B. E. (2008). Predictive Learning via Rule Ensembles. The Annals of Applied Statistics, 2(3), 916–954. http://www.jstor.org/stable/30245114