Description Usage Arguments Value References Examples

From DALEX version 1.0 this function calls the `feature_importance`

Find information how to use this function here: https://pbiecek.github.io/ema/featureImportance.html.

1 2 3 4 5 6 7 8 | ```
model_parts(
explainer,
loss_function = loss_default(explainer$model_info$type),
...,
type = "variable_importance",
N = n_sample,
n_sample = 1000
)
``` |

`explainer` |
a model to be explained, preprocessed by the |

`loss_function` |
a function that will be used to assess variable importance. By default it is 1-AUC for classification, cross entropy for multilabel classification and RMSE for regression. |

`...` |
other parameters |

`type` |
character, type of transformation that should be applied for dropout loss. |

`N` |
number of observations that should be sampled for calculation of variable importance. If negative then variable importance will be calculated on whole dataset (no sampling). |

`n_sample` |
alias for |

An object of the class `feature_importance`

.
It's a data frame with calculated average response.

Explanatory Model Analysis. Explore, Explain and Examine Predictive Models. https://pbiecek.github.io/ema/

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
## Not run:
library("ranger")
titanic_ranger_model <- ranger(survived~., data = titanic_imputed, num.trees = 50,
probability = TRUE)
explainer_ranger <- explain(titanic_ranger_model, data = titanic_imputed[,-8],
y = titanic_imputed$survived)
vi_ranger <- model_parts(explainer_ranger, type = "raw")
head(vi_ranger, 8)
plot(vi_ranger)
titanic_glm_model <- glm(survived~., data = titanic_imputed, family = "binomial")
explainer_glm <- explain(titanic_glm_model, data = titanic_imputed[,-8],
y = titanic_imputed$survived)
logit <- function(x) exp(x)/(1+exp(x))
vi_glm <- model_parts(explainer_glm, type = "raw",
loss_function = function(observed, predicted)
sum((observed - logit(predicted))^2))
head(vi_glm, 8)
plot(vi_glm)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.