Extract a model workflow predictions from a tidyAML model tibble.
Arguments
- .data
The model table that must have the class
tidyaml_mod_spec_tbl
.- .model_id
The model number that you want to select, Must be an integer or sequence of integers, ie.
1
orc(1,3,5)
or1:2
Details
This function allows you to get a model workflow predictions or more from
a tibble with a class of "tidyaml_mod_spec_tbl". It allows you to select the
model by the .model_id
column. You can call the model id's by an integer
or a sequence of integers.
See also
Other Extractor:
extract_model_spec()
,
extract_wflw_fit()
,
extract_wflw()
,
get_model()
Examples
library(recipes)
rec_obj <- recipe(mpg ~ ., data = mtcars)
frt_tbl <- fast_regression(mtcars, rec_obj, .parsnip_eng = c("lm","glm"),
.parsnip_fns = "linear_reg")
extract_wflw_pred(frt_tbl, 1)
#> [[1]]
#> # A tibble: 24 × 1
#> .pred
#> <dbl>
#> 1 23.8
#> 2 15.5
#> 3 28.1
#> 4 27.0
#> 5 13.6
#> 6 22.0
#> 7 29.3
#> 8 28.5
#> 9 24.5
#> 10 10.3
#> # … with 14 more rows
#>
extract_wflw_pred(frt_tbl, 1:2)
#> [[1]]
#> # A tibble: 24 × 1
#> .pred
#> <dbl>
#> 1 23.8
#> 2 15.5
#> 3 28.1
#> 4 27.0
#> 5 13.6
#> 6 22.0
#> 7 29.3
#> 8 28.5
#> 9 24.5
#> 10 10.3
#> # … with 14 more rows
#>
#> [[2]]
#> # A tibble: 24 × 1
#> .pred
#> <dbl>
#> 1 23.8
#> 2 15.5
#> 3 28.1
#> 4 27.0
#> 5 13.6
#> 6 22.0
#> 7 29.3
#> 8 28.5
#> 9 24.5
#> 10 10.3
#> # … with 14 more rows
#>