Utility function to prepare data for training in a Pycox model. Generally used internally only.
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")
)
(matrix(1))
Training covariates.
(matrix(1))
Training outcomes.
(numeric(1))
Fraction of data to use for validation dataset, default is 0
and therefore no separate validation dataset.
(logical(1))
If TRUE
, the time outcome to be standardized. For use
with coxtime.
(logical(1))
If TRUE
and standardize_time
is TRUE
then time
variable is log transformed.
(logical(1))
If TRUE
(default) and standardize_time
is TRUE
then time
variable is centered.
(logical(1))
If TRUE
(default) and standardize_time
is TRUE
then time
variable is scaled to unit variance.
(integer(1))
If discretise
is TRUE
then determines number of cut-points
for discretisation.
(numeric())
Alternative to cuts
if discretise
is true, provide
exact cutpoints for discretisation. cuts
is ignored if cutpoints
is non-NULL.
(character(1))
Method of discretisation, either "equidistant"
(default)
or "quantiles"
. See reticulate::py_help(pycox$models$LogisticHazard$label_transform)
.
(integer(1))
Starting duration for discretisation, see
reticulate::py_help(pycox$models$LogisticHazard$label_transform)
.
(character(1))
Corresponding pycox model.