r descr_models("survival_reg", "survival")

Tuning Parameters

defaults <- 
  tibble::tibble(parsnip = c("dist"),
                 default = c("'weibull'"))

param <-
  survival_reg() %>%
  set_engine("survival") %>%
  set_mode("censored regression") %>%
  make_parameter_list(defaults)

This model has r nrow(param) tuning parameters:

param$item

Translation from parsnip to the original package

r uses_extension("survival_reg", "survival", "censored regression")

library(censored)

survival_reg(dist = character(1)) %>% 
  set_engine("survival") %>% 
  set_mode("censored regression") %>% 
  translate()

Other details

In the translated syntax above, note that model = TRUE is needed to produce quantile predictions when there is a stratification variable and can be overridden in other cases.

The main interface for this model uses the formula method since the model specification typically involved the use of [survival::Surv()].

The model formula can include special terms, such as [survival::strata()]. The allows the model scale parameter to differ between groups contained in the function. The column used inside strata() is treated as qualitative no matter its type. To learn more about using special terms in formulas with tidymodels, see [?model_formula][parsnip::model_formula].

For example, in this model, the numeric column rx is used to estimate two different scale parameters for each value of the column:

library(survival)

survival_reg() %>% 
  fit(Surv(futime, fustat) ~ age + strata(rx), data = ovarian) %>% 
  extract_fit_engine()

Case weights


Saving fitted model objects


References



topepo/parsnip documentation built on April 16, 2024, 3:23 a.m.