View source: R/parsnip_broom.R
| augment.ggmlr_parsnip_model | R Documentation |
Adds prediction columns to 'new_data', broom style. For classification this appends '.pred_class' plus one '.pred_<level>' probability column per class; for regression it appends '.pred'. Predictions are produced by the existing 'predict()' method for ggml parsnip models (no duplicate inference logic).
## S3 method for class 'ggmlr_parsnip_model'
augment(x, new_data, ...)
x |
A fitted 'ggmlr_parsnip_model' (the engine object inside a parsnip fit; e.g. from 'extract_fit_engine()'). |
new_data |
A data frame of predictors (same columns used for fitting). |
... |
Unused; for generic compatibility. |
'new_data' as a tibble with prediction columns appended.
ggml_set_n_threads(1L) # deterministic, single OpenMP pool
spec <- parsnip::mlp(hidden_units = 8L, epochs = 3L) |>
parsnip::set_engine("ggml", backend = "cpu") |>
parsnip::set_mode("regression")
fit_obj <- parsnip::fit(spec, mpg ~ ., data = mtcars)
generics::augment(parsnip::extract_fit_engine(fit_obj), mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.