importance: Get the feature importance of an 'Xy()' simulation

View source: R/importance.R

importanceR Documentation

Get the feature importance of an Xy() simulation

Description

Get the feature importance of an Xy() simulation

Usage

importance(object, plot = TRUE)

Arguments

object

an object of class xy_sim

plot

a boolean signaling whether to print an importance plot

Details

The importance is calculated as the relative local contribution of the effect, for instance the absolute share of a linear simulated effect (x_1) to the overall magnitude of y. The relative shares are then aggregated over the whole simulated data set

Value

Returns the effect importance of a cooked simulation recipe. The plot argument can be used to create a feature importance plot.

Examples

# create a simulation
linear_sim <- Xy() %>%
  add_linear(p = 5) %>%
  Xy::simulate(n = 100)
# fetch the variable importance of the simualtion
linear_sim %>% importance()

andrebleier/Xy documentation built on March 29, 2023, 12:41 p.m.