diff --git a/DESCRIPTION b/DESCRIPTION index 7bddd89..c72175d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,6 +25,7 @@ Suggests: duckdb, embed, glue, + gt, hardhat, jsonlite, kknn, @@ -39,11 +40,12 @@ Suggests: sparklyr, testthat (>= 3.0.0), themis, + tibble, tidypredict, workflows VignetteBuilder: knitr -Config/Needs/website: tidyverse/tidytemplate, rmarkdown +Config/Needs/website: tidyverse/tidytemplate, rmarkdown, gt Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) diff --git a/vignettes/supported-models.Rmd b/vignettes/supported-models.Rmd index ba37e69..e25f477 100644 --- a/vignettes/supported-models.Rmd +++ b/vignettes/supported-models.Rmd @@ -7,29 +7,68 @@ vignette: > %\VignetteEncoding{UTF-8} --- -The supported models currently all come from [tidypredict](https://tidypredict.tidymodels.org/) right now. +The supported methods currently all come from [tidypredict](https://tidypredict.tidymodels.org/) right now. ## Supported models -The following models are supported by `tidypredict`: +This table doesn't exhaustively list fully unsupported models. Please file [an issue](https://github.com/tidymodels/orbital/issues) to add model to table. -- Linear Regression - `lm()` -- Generalized Linear model - `glm()` -- Random Forest models - `randomForest::randomForest()` -- Random Forest models, via `ranger` - `ranger::ranger()` -- MARS models - `earth::earth()` -- XGBoost models - `xgboost::xgb.Booster.complete()` -- Cubist models - `Cubist::cubist()` -- Tree models, via `partykit` - `partykit::ctree()` - -### `parsnip` +```{r} +#| echo: false +#| message: false +if (!rlang::is_installed(c("gt", "tibble"))) { + knitr::knit_exit() +} +``` -`tidypredict` supports models fitted via the `parsnip` interface. The ones confirmed currently work in `tidypredict` are: +```{r} +#| echo: false +#| message: false +library(gt) +library(dplyr) -- `lm()` - `parsnip`: `linear_reg()` with *"lm"* as the engine. -- `randomForest::randomForest()` - `parsnip`: `rand_forest()` with *"randomForest"* as the engine. -- `ranger::ranger()` - `parsnip`: `rand_forest()` with *"ranger"* as the engine. -- `earth::earth()` - `parsnip`: `mars()` with *"earth"* as the engine. +tibble::tribble( + ~parsnip, ~engine, ~numeric, ~class, ~prob, + "`boost_tree()`", "`\"xgboost\"`", "✅", "⚪", "⚪", + "`cubist_rules()`", "`\"Cubist\"`", "✅", "❌", "❌", + "`decision_tree()`", "`\"partykit\"`", "✅", "⚪", "⚪", + "`linear_reg()`", "`\"lm\"`", "✅", "❌", "❌", + "`linear_reg()`", "`\"glmnet\"`", "⚪", "❌", "❌", + "`logistic_reg()`", "`\"glm\"`", "❌", "✅", "⚪", + "`logistic_reg()`", "`\"glmnet\"`", "❌", "⚪", "⚪", + "`mars()`", "`\"earth\"`", "✅", "⚪", "⚪", + "`naive_Bayes()`", "`\"naivebayes\"`", "❌", "⚪", "⚪", + "`nearest_neighbor()`", "`any`", "❌", "❌", "❌", + "`rand_forest()`", "`\"randomForest\"`", "✅", "⚪", "⚪", + "`rand_forest()`", "`\"ranger\"`", "✅", "⚪", "⚪" +) |> + gt() |> + tab_spanner( + label = "Model", + columns = c(parsnip, engine) + ) |> + tab_spanner( + label = "Regression", + columns = c(numeric) + ) |> + tab_spanner( + label = "Classification", + columns = c(class, prob) + ) |> + tab_header( + title = "Supported Prediction Types" + ) |> + cols_align( + "center", + columns = c(numeric, class, prob) + ) |> + tab_footnote("✅: Supported") |> + tab_footnote("❌: Cannot be supported") |> + tab_footnote("⚪: Not yet supported") |> + fmt_markdown( + columns = c(parsnip, engine) + ) +``` ## Recipes steps