DALEX (version 0.3.0)

predict.explainer: Wrapper over the predict function

Description

This function works for explain objects. It calles embeded predict function.

Usage

# S3 method for explainer
predict(object, newdata, ...)

Arguments

object

a model to be explained, object of the class 'explainer'

newdata

data.frame or matrix - observations for prediction

...

other parameters that will be passed to the predict function

Value

An numeric matrix of predictions

Examples

Run this code
# NOT RUN {
HR_glm_model <- glm(status == "fired"~., data = HR, family = "binomial")
explainer_glm <- explain(HR_glm_model, data = HR)
predict(explainer_glm, HR[1:3,])

 
# }
# NOT RUN {
library("randomForest")
HR_rf_model <- randomForest(status == "fired" ~., data = HR)
explainer_rf  <- explain(HR_rf_model, data = HR)
predict(explainer_rf, HR[1:3,])
 
# }

Run the code above in your browser using DataLab