gbm_2way: Two-way interactions

View source: R/gbm_2way.R

gbm_2wayR Documentation

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)

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.

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.

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


bgreenwell/treemisc documentation built on Oct. 26, 2022, 12:56 a.m.