View source: R/safely_detect_interactions.R
safely_detect_interactions | R Documentation |
The safely_detect_interactions() function detects second-order interactions based on predictions made by a surrogate model. For each pair of features it performs values permutation in order to evaluate their non_additive effect.
safely_detect_interactions( explainer, inter_param = 0.5, inter_threshold = 0.5, verbose = TRUE )
explainer |
DALEX explainer created with explain() function |
inter_param |
numeric, a positive value indicating which of single observation non-additive effects are to be regarded as significant, the higher value the higher non-additive effect has to be to be taken into account |
inter_threshold |
numeric, a value from |
verbose |
logical, if progress bar is to be printed |
dataframe object containing interactions effects greater than or equal to the specified inter_threshold
safe_extraction
library(DALEX) library(randomForest) library(rSAFE) data <- apartments[1:500,] set.seed(111) model_rf <- randomForest(m2.price ~ construction.year + surface + floor + no.rooms + district, data = data) explainer_rf <- explain(model_rf, data = data[,2:6], y = data[,1]) safely_detect_interactions(explainer_rf, inter_param = 0.25, inter_threshold = 0.2, verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.