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.

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



Try the parsnip package in your browser

Any scripts or data that you put into this service are public.

parsnip documentation built on Aug. 18, 2023, 1:07 a.m.