explain: Explain forester model

View source: R/explain.R

explainR Documentation

Explain forester model

Description

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

Usage

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, if set to TRUE, provides all information about the process, if FALSE gives none.

Value

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

Examples

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

## End(Not run)

ModelOriented/forester documentation built on June 6, 2024, 7:29 a.m.