Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vip2vivid

vip2vivid


Description

@description Takes measured importance and interactions from the vip package and turns them into a matrix which can be used for plotting. Accepts any of the variable importance methods supplied by vip.

Usage

vip2vivid(importance, interaction, reorder = TRUE)

Arguments

importance

Measured importance from the vip package using vi function.

interaction

Measured interaction from the vip package using vint function.

reorder

If TRUE (default) uses DendSer to reorder the matrix of interactions and variable importances.

Value

A matrix of interaction values, with importance on the diagonal.

Examples

## Not run: 
library(ranger)
library(vip)
aq <- na.omit(airquality) # get data
nameAq <- names(aq[-1]) # get feature names

rF <- ranger(Ozone ~ ., data = aq, importance = "permutation") # create ranger random forest fit
vImp <- vi(rF) # vip importance
vInt <- vint(rF, feature_names = nameAq) # vip interaction

vip2vivid(vImp, vInt)

## End(Not run)

vivid

Variable Importance and Variable Interaction Displays

v0.1.0
GPL (>= 2)
Authors
Alan Inglis [aut, cre], Andrew Parnell [aut], Catherine Hurley [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.