Creating model explainer
library("randomForest")
library("DALEX")
explain_rf <- DALEX::explain(model = titanic_rf,
data = titanic_imputed[, -9],
y = titanic_imputed$survived == "yes",
label = "Random Forest")
## Preparation of a new explainer is initiated
## -> model label : Random Forest
## -> data : 2207 rows 8 cols
## -> target variable : 2207 values
## -> predict function : yhat.randomForest will be used ( default )
## -> predicted values : No value for predict function target column. ( default )
## -> model_info : package randomForest , ver. 4.7.1.1 , task classification ( default )
## -> model_info : Model info detected classification task but 'y' is a logical . Converted to numeric. ( NOTE )
## -> predicted values : numerical, min = 0 , mean = 0.2353095 , max = 1
## -> residual function : difference between y and yhat ( default )
## -> residuals : numerical, min = -0.892 , mean = 0.0868473 , max = 1
## A new explainer has been created!
predict(explain_rf, henry)
## [1] 0.246