| kerasnip_output_view | R Documentation |
tailor and probably are built around models with a single outcome
column and a single .pred/.pred_class prediction column. A kerasnip
multi-output model (e.g. a recipe with output_1 + output_2 ~ .) instead
produces .pred_output_1, .pred_output_2, ... columns from multiple
truth columns in one fit — the standard parsnip::maybe_multivariate()
shape, but one tailor::fit()/workflows::add_tailor() call cannot
consume it (it selects outcome/estimate via [[, which requires
exactly one column).
kerasnip_output_view() wraps a fitted multi-output workflow together
with one output name, presenting it as if it were an ordinary
single-output fit: predict() returns standard .pred / .pred_class /
.pred_<level> columns for that output alone, letting you calibrate or
post-process each output separately with the usual tailor/probably
calls (see vignette("multi_output_postprocessing")).
kerasnip_output_view(x, output)
x |
A fitted (trained) |
output |
A string, the name of the outcome column to view. |
A kerasnip_output_view object.
## Not run:
fit_obj <- fit(wf, data = train_data) # wf predicts output_1 and output_2
view_1 <- kerasnip_output_view(fit_obj, "output_1")
predict(view_1, new_data = test_data) # -> a single `.pred` column
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.