Examp
#> Null Deviance: 4055
#> Residual Deviance: 3698 AIC: 3704
using_xy
#> parsnip model object
#>
-#> Fit in: 21ms
+#> Fit in: 18ms
#> Call: stats::glm(formula = formula, family = stats::binomial, data = data)
#>
#> Coefficients:
diff --git a/vignettes/articles/Models.Rmd b/vignettes/articles/Models.Rmd
index 653893c72..be1fd9e77 100644
--- a/vignettes/articles/Models.Rmd
+++ b/vignettes/articles/Models.Rmd
@@ -17,6 +17,7 @@ knitr::opts_chunk$set(
)
options(digits = 3)
library(parsnip)
+library(discrim)
library(tidymodels)
library(cli)
library(kableExtra)
@@ -24,9 +25,12 @@ library(kableExtra)
`parsnip` contains wrappers for a number of models. For example, the `parsnip` function `rand_forest()` can be used to create a random forest model. The **mode** of a model is related to its goal. Examples would be regression and classification.
-The list of models accessible via `parsnip` is:
+Since there are many models available in R, there are also "side packages" that wrap groups of models:
-```{r model-table, results = 'asis', echo = FALSE}
+ * [`discrim`](https://github.com/tidymodels/discrim) contains discriminant analysis models.
+
+
+```{r model-table, include = FALSE}
mod_names <- get_from_env("models")
mod_list <-
@@ -36,19 +40,38 @@ mod_list <-
arrange(mode, model) %>%
group_by(mode) %>%
summarize(models = paste(model, collapse = ", "))
+```
+
+_How_ the model is created is related to the **engine**. In many cases, this is an R modeling package. In others, it may be a connection to an external system (such as Spark or Tensorflow). The tables below list the engines for each model type along with the type of prediction that it can make (see `predict.model_fit()`).
+
+Models can be added by the user too. See the ["Making a {parsnip} model from scratch" vignette](Scratch.html).
-for (i in 1:nrow(mod_list)) {
- cat(mod_list[["mode"]][i], ": ",
- mod_list[["models"]][i], "\n\n\n",
- sep = "")
-}
+The list of models accessible via `parsnip` and `discrim` are listed below:
+
+
+## Classification Models
+
+```{r class-table, results = 'asis', echo = FALSE}
+map_dfr(mod_names, ~ get_from_env(paste0(.x, "_predict")) %>% mutate(model = .x)) %>%
+ dplyr::filter(mode == "classification") %>%
+ dplyr::select(model, engine, type) %>%
+ mutate(
+ type = paste0("`", type, "`"),
+ model = paste0("`", model, "()`"),
+ ) %>%
+ mutate(check = cli::symbol$tick) %>%
+ spread(type, check, fill = cli::symbol$times) %>%
+ kable(format = "html") %>%
+ kable_styling(full_width = FALSE) %>%
+ collapse_rows(columns = 1)
```
-_How_ the model is created is related to the _engine_. In many cases, this is an R modeling package. In others, it may be a connection to an external system (such as Spark or Tensorflow). This table lists the engines for each model type along with the type of prediction that it can make (see `predict.model_fit()`).
+## Regression Models
```{r pred-table, results = 'asis', echo = FALSE}
map_dfr(mod_names, ~ get_from_env(paste0(.x, "_predict")) %>% mutate(model = .x)) %>%
- dplyr::select(-value) %>%
+ dplyr::filter(mode == "regression") %>%
+ dplyr::select(model, engine, type) %>%
mutate(
type = paste0("`", type, "`"),
model = paste0("`", model, "()`"),
@@ -60,5 +83,6 @@ map_dfr(mod_names, ~ get_from_env(paste0(.x, "_predict")) %>% mutate(model = .x)
collapse_rows(columns = 1)
```
-Models can be added by the user too. See the ["Making a `parsnip` model from scratch" vignette](Scratch.html).
+
+