The class takes an object containing a prediction model and decomposes it into its essential parts.

Public fields

model_object

(?) A model object to decompose.

data

(data.frame) A data table with the data used to create model_object.

role_target

(character) The name of the target variable in model_object.

role_input

(character) The name of the target variable model_object.

Methods

Public methods


Method set_data()

Substitute the default data with a different dataset. This is useful when you have a model which was fitted on a train set, but you want to explain the test set.

Usage

ModelDecomposition$set_data(data)

Arguments

data

(data.frame) A data table with columns that correspond to variables used in the model.


Method predict_function()

Predict method for object.

Usage

ModelDecomposition$predict_function(object, newdata = NULL)

Arguments

object

(?) A model object to decompose.

newdata

(data.frame)` A data table in which to look for variables with which to predict.


Method new()

Decompose a given object to its essential parts.

Usage

ModelDecomposition$new(object)

Arguments

object

(?) A model object to decompose.