xgb.fi: A XGboost Feature Interaction Graphing Function

Description Usage Arguments Examples

Description

This function allows you to generate a shiny app that outputs the interaction of an xgbmodel.

Usage

1
2
3
xgb.fi(model, xgbfi.loc = "C:/xgbfi", features = NULL,
  max.interaction.depth = 2, max.deepening = -1, max.trees = -1,
  top.k = 100, max.histograms = 10)

Arguments

model

type: XGBModel

xgbfi.loc

type: filepath File path for the XGBfi folder. Default is C:/xgbfi

features

type: Character Vector A character vector of the features in the model.

max.interaction.depth

type: integer Upper bound for extracted feature interactions depth

max.deepening

type: integer Upper bound for interaction start deepening (zero deepening => interactions starting @root only)

max.trees

type: integer Upper bound for trees to be parsed

top.k

type: integer Upper bound for exportet feature interactions per depth level

max.histograms

type: integer Amounts of split value histograms

Examples

1
2
3
4
5
6
7
library(xgboost)
library(Ecdat)
data(Icecream)
train.data <- data.matrix(Icecream[,-1])
bst <- xgboost(data = train.data, label = Icecream$cons, max.depth = 3, eta = 1, nthread = 2, nround = 2, objective = "reg:linear")
features <- names(Icecream[,-1])
xgb.fi(model = bst, features = features)

RSimran/RXGBfi documentation built on May 8, 2019, 7:34 a.m.