Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated supported models #67

Merged
merged 6 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Suggests:
duckdb,
embed,
glue,
gt,
hardhat,
jsonlite,
kknn,
Expand All @@ -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)
Expand Down
73 changes: 56 additions & 17 deletions vignettes/supported-models.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading