pycox_prepare_train_data: Prepare Data for Pycox Model Training

View source: R/helpers_pycox.R

pycox_prepare_train_dataR Documentation

Prepare Data for Pycox Model Training

Description

Utility function to prepare data for training in a Pycox model. Generally used internally only.

Usage

pycox_prepare_train_data(
  x_train,
  y_train,
  frac = 0,
  standardize_time = FALSE,
  log_duration = FALSE,
  with_mean = TRUE,
  with_std = TRUE,
  discretise = FALSE,
  cuts = 10L,
  cutpoints = NULL,
  scheme = c("equidistant", "quantiles"),
  cut_min = 0L,
  model = c("coxtime", "deepsurv", "deephit", "loghaz", "pchazard")
)

Arguments

x_train

(matrix(1))
Training covariates.

y_train

(matrix(1))
Training outcomes.

frac

(numeric(1))
Fraction of data to use for validation dataset, default is 0 and therefore no separate validation dataset.

standardize_time

(logical(1))
If TRUE, the time outcome to be standardized. For use with coxtime.

log_duration

(logical(1))
If TRUE and standardize_time is TRUE then time variable is log transformed.

with_mean

(logical(1))
If TRUE (default) and standardize_time is TRUE then time variable is centered.

with_std

(logical(1))
If TRUE (default) and standardize_time is TRUE then time variable is scaled to unit variance.

discretise

(logical(1))
If TRUE then time is discretised. For use with the models deephit, pchazard, and loghaz.

cuts

(integer(1))
If discretise is TRUE then determines number of cut-points for discretisation.

cutpoints

(numeric())
Alternative to cuts if discretise is true, provide exact cutpoints for discretisation. cuts is ignored if cutpoints is non-NULL.

scheme

(character(1))
Method of discretisation, either "equidistant" (default) or "quantiles". See reticulate::py_help(pycox$models$LogisticHazard$label_transform).

cut_min

(integer(1))
Starting duration for discretisation, see reticulate::py_help(pycox$models$LogisticHazard$label_transform).

model

(character(1))
Corresponding pycox model.


survivalmodels documentation built on March 24, 2022, 9:05 a.m.