The `explain()` function is a wrapper for `DALEX` methods for model explanations. If possible it will use methods for tree-based models.

explain(models, test_data, y, verbose = FALSE)

Arguments

models

A single model or the model list created with the `train()` function.

test_data

A test dataset returned from `train()` function.

y

A target variable. It can be either (1) a vector of the same number of observations as `data` or (2) a character name of variable in the `data` that contains the target variable.

verbose

A logical value determining whether explainer creation messages should be printed or not.

Value

A list of DALEX explainers for 5 models of different engines.

Examples

data(lisbon)
train_output   <- train(lisbon, 'Price', verbose = FALSE, random_evals = 2, bayes_iter = 1)
best_explainer <- explain(train_output$best_models[[1]][1], train_output$valid_data, train_output$y)
best_explainers <- explain(train_output$best_models[[1]], train_output$valid_data, train_output$y)