xgboostVariableImportance: Get the variable Importance of a xgboost Model

Description Usage Arguments Value Examples

Description

Generic Function to get the importance of features in a xgboost model

Usage

1
xgboostVariableImportance(mod, N = 30, allowedVariables = NULL)

Arguments

mod

a Model from xgboostModel

N

The Number of features to return

allowedVariables

Features that are allowed to be included

Value

A list containing a data.table with the variable importance scores and a ggplot

Examples

1
2
3
4
5
6
7
8
set.seed(42)
x = iris
x$Species = ifelse(x$Species == "versicolor",1, 0)
dat = splitDataToTrainTestDataFrame(x,.9,.25)
mod = xgboostModel(dat,"Species")
v = xgboostVariableImportance(mod)

v = xgboostVariableImportance(mod, 30, allowedVariables = c("Sepal.Length","Sepal.Width"))

ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.