Description Usage Arguments Value Examples
This function shows:
plot for the importance of single variables,
tree that shows importance for every newly expanded group of variables,
clustering tree.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | calculate_triplot(x, ...)
## S3 method for class 'explainer'
calculate_triplot(
x,
type = c("predict", "model"),
new_observation = NULL,
N = 1000,
loss_function = DALEX::loss_root_mean_square,
B = 10,
fi_type = c("raw", "ratio", "difference"),
clust_method = "complete",
cor_method = "spearman",
...
)
## Default S3 method:
calculate_triplot(
x,
data,
y = NULL,
predict_function = predict,
label = class(x)[1],
type = c("predict", "model"),
new_observation = NULL,
N = 1000,
loss_function = DALEX::loss_root_mean_square,
B = 10,
fi_type = c("raw", "ratio", "difference"),
clust_method = "complete",
cor_method = "spearman",
...
)
## S3 method for class 'triplot'
print(x, ...)
model_triplot(x, ...)
predict_triplot(x, ...)
|
x |
an explainer created with the |
... |
other parameters |
type |
if |
new_observation |
selected observation with columns that corresponds to variables used in the model, should be without target variable |
N |
number of rows to be sampled from data
NOTE: Small |
loss_function |
a function that will be used to assess variable
importance, if |
B |
integer, number of permutation rounds to perform on each variable
in feature importance calculation, if |
fi_type |
character, type of transformation that should be applied for
dropout loss, if |
clust_method |
the agglomeration method to be used, see
|
cor_method |
the correlation method to be used see
|
data |
dataset, it will be extracted from |
y |
true labels for |
predict_function |
predict function, it will be extracted from |
label |
name of the model. By default it's extracted from the 'class' attribute of the model. |
triplot object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(DALEX)
set.seed(123)
apartments_num <- apartments[,unlist(lapply(apartments, is.numeric))]
apartments_num_lm_model <- lm(m2.price ~ ., data = apartments_num)
apartments_num_new_observation <- apartments_num[30, ]
explainer_apartments <- explain(model = apartments_num_lm_model,
data = apartments_num[,-1],
y = apartments_num[, 1],
verbose = FALSE)
apartments_tri <- calculate_triplot(x = explainer_apartments,
new_observation =
apartments_num_new_observation[-1])
apartments_tri
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.