-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
It would be great to have an option to pass arguments to explainers.
For example, I would like to generate modelDown with my own loss function for a variable_importance() function.
An analogy for doing something like this, but with modelDown:
library("breakDown")
library("randomForest")
HR_rf_model <- randomForest(factor(status == "fired")~., data = HR, ntree = 100)
explainer_rf <- explain(HR_rf_model, data = HR, y = HR$status == "fired")
custom_loss_auc <- function(y, yhat) {
1 - mltools::auc_roc(yhat, y)
}
vd_rf <- variable_importance(explainer_rf, loss = custom_loss_auc)
vd_rf
How about adding parameter params that takes a list with names corresponding to explainer's parameters? For the example above it would be something like this:
modelDown(explainer_rf, params = list("variable_importance" = list(loss = custom_loss))
Metadata
Metadata
Assignees
Labels
No labels