tidymodels / parsnip

A tidy unified interface to models
https://parsnip.tidymodels.org
Other
590 stars 88 forks source link

add utility to list needed engine packages #1113

Closed simonpcouch closed 5 months ago

simonpcouch commented 5 months ago

For installation/setup purposes, it'd be great to have some kind of utility to find all of the engine package installs needed to plausibly fit any model in the parsnip model env. In other words, if parsnip listed all engines it supports in Suggests, what would they be?

I used this while setting up a new machine the other day to do so with a version of the model env that includes all engines supported by parsnip extensions:

library(tidyverse)
library(tidymodels)
lapply(parsnip:::extensions(), require, character.only = TRUE)
env <- parsnip::get_model_env()
pkgs_list <- as.list(env)[grepl("_pkgs", names(env), fixed= TRUE)]

all_possible_dependencies <-
  pkgs_list %>% 
  bind_rows() %>% 
  pull(pkg) %>% 
  list_flatten() %>% 
  unlist() %>% 
  unique()
EmilHvitfeldt commented 5 months ago

Is this different than parsnip:::install_engine_packages()? https://github.com/tidymodels/parsnip/blob/main/R/install_packages.R

simonpcouch commented 5 months ago

Not different enough to warrant this issue--thanks. :)

github-actions[bot] commented 4 months ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.