# model_profile

##### Dataset Level Variable Profile as Partial Dependence or Accumulated Local Dependence Explanations

This function calculates explanations on a dataset level set that explore model response as a function of selected variables.
The explanations can be calulated as Partial Dependence Profile or Accumulated Local Dependence Profile.
Find information how to use this function here: https://pbiecek.github.io/ema/partialDependenceProfiles.html.
The `variable_profile`

function is a copy of `model_profile`

.

##### Usage

```
model_profile(
explainer,
variables = NULL,
N = 100,
...,
groups = NULL,
k = NULL,
center = TRUE,
type = "partial"
)
```variable_profile(
explainer,
variables = NULL,
N = 100,
...,
groups = NULL,
k = NULL,
center = TRUE,
type = "partial"
)

single_variable(explainer, variable, type = "pdp", ...)

##### Arguments

- explainer
a model to be explained, preprocessed by the

`explain`

function- variables
character - names of variables to be explained

- N
number of observations used for calculation of aggregated profiles. By default 100.

- ...
other parameters that will be passed to

`ingredients::aggregate_profiles`

- groups
a variable name that will be used for grouping. By default

`NULL`

which means that no groups shall be calculated- k
number of clusters for the hclust function (for clustered profiles)

- center
shall profiles be centered before clustering

- type
the type of variable profile. Either

`partial`

,`conditional`

or`accumulated`

.- variable
deprecated, use variables instead

##### Details

Underneath this function calls the `partial_dependency`

or
`accumulated_dependency`

functions from the `ingredients`

package.

##### Value

An object of the class `model_profile`

.
It's a data frame with calculated average model responses.

##### References

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

##### Examples

```
# NOT RUN {
titanic_glm_model <- glm(survived~., data = titanic_imputed, family = "binomial")
explainer_glm <- explain(titanic_glm_model, data = titanic_imputed)
expl_glm <- model_profile(explainer_glm, "fare")
plot(expl_glm)
# }
# 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)
expl_ranger <- model_profile(explainer_ranger)
plot(expl_ranger, geom = "profiles")
vp_ra <- model_profile(explainer_ranger, type = "partial", variables = c("age", "fare"))
plot(vp_ra, variables = c("age", "fare"), geom = "points")
vp_ra <- model_profile(explainer_ranger, type = "partial", k = 3)
plot(vp_ra, geom = "profiles")
vp_ra <- model_profile(explainer_ranger, type = "partial", groups = "gender")
plot(vp_ra, geom = "profiles")
vp_ra <- model_profile(explainer_ranger, type = "accumulated")
plot(vp_ra, geom = "profiles")
# }
# NOT RUN {
# }
```

*Documentation reproduced from package DALEX, version 1.2.1, License: GPL*