Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom parameters for explainer functions #75

Open
agosiewska opened this issue Jul 2, 2019 · 0 comments
Open

Custom parameters for explainer functions #75

agosiewska opened this issue Jul 2, 2019 · 0 comments

Comments

@agosiewska
Copy link
Member

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant