Open mevers opened 1 year ago
Hi @mevers, I might be missing something here, but it seems to fail because your prediction wrapper fails:
#
# Test out prediction wrapper
#
X <- recipe %>% prep() %>% bake(new_data = NULL) %>% select(-c(mpg))
predict(fitted_model, new_data = X)
# Error in `validate_column_names()`:
# ! The following required columns are missing: 'qsec'.
# Run `rlang::last_error()` to see where the error occurred.
There's no qsec
term in the underlying fit, so maybe cross-list this question with the hardhat and/or workflows repos?
Reprex:
This throws an error
This is because
fitted_model
retains a reference toqsec
even though the variable was removed during pre-processing inrecipe
.Question: What is the canonical way to supply
X
here? I could referencedata
directlybut (1) this doesn't seem to be very
tidymodels
-canonical, and (2) this then includesqsec
in the SHAP analysis (which it shouldn't). A fix to that issue would be to use thefeature_names
argument to excludeqsec
, but this seems unnecessarily complicated.What is the
fastshap
-way to provideX
via arecipe
?