DALEX (version 0.4.4)

loss_cross_entropy: Preimplemented Loss Functions

Description

Preimplemented Loss Functions

Usage

loss_cross_entropy(observed, predicted, p_min = 1e-04, na.rm = TRUE)

Arguments

observed

observed scores or labels, these are supplied as explainer specific `y`

predicted

predicted scores, either vector of matrix, these are returned from the model specific `predict_function()``

p_min

for cross entropy, minimal value for probability to make sure that `log` will not explode

na.rm

logical, should missing values be removed?

Value

numeric - value of the loss function

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
library("randomForest")
HR_rf_model <- randomForest(status~., data = HR, ntree = 100)
loss_cross_entropy(HR$status, yhat(HR_rf_model))
 
# }

Run the code above in your browser using DataCamp Workspace