2

I want to use modelStudio and for that I need to make explainer using DALEX::explain() that takes model object as an argument. I should, but I am not sure how to provide the entire reproducible example code with data here!

When I use the following code

    xgb <- boost_tree(mode = "classification",
                  trees = 100,
                  mtry = 0.7,
                  learn_rate = 0.15,
                  tree_depth = 10,
                  sample_size = 1) %>%
  set_engine("xgboost") %>%
  fit(Y ~ ., data = train)

the following explainer works:

explainer <- explain(xgb,
                     data = test,
                     y = test$Y,
                     predict_function = , 
                     label = "xgb")

but when I use the entire workflow and try extracting the model using pull_workflow_fit, it breaks saying it can't predict.

xgb1 <- final_xgb %>%
   fit(data = train) %>%
   pull_workflow_fit()

classes in both the cases are _xgb.Booster model_fit.

Which function in tidymodels or workflow will render the object that exactly matches with the xgb (first code chunk above) model?

Geet
  • 2,515
  • 2
  • 19
  • 42

0 Answers0