prepare_train_data: Prepare Data for Pycox Model Training

Description Usage Arguments

View source: R/helpers.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
prepare_train_data(
  task,
  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
)

Arguments

task

mlr3proba::TaskSurv
Survival task for extracting data.

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 be standardized. For use with LearnerSurvCoxtime.

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 LearnerSurvDeephit, LearnerSurvPCHazard, and LearnerSurvLogisticHazard.

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, one of "DeepHit", "LH", "PCH", and "CoxTime".


mlr3learners/mlr3learners.pycox documentation built on Sept. 24, 2020, 10:40 a.m.