Public methods
Method new()
Creates a new instance of this R6 class.
Usage
TaskSurv$new(
id,
backend,
time,
event,
time2,
type = c("right", "left", "counting", "interval", "interval2", "mstate")
)
Arguments
id
(character(1)
)
Identifier for the new instance.
backend
(DataBackend)
Either a DataBackend, or any object which is convertible to a DataBackend with as_data_backend()
.
E.g., a data.frame()
will be converted to a DataBackendDataTable.
time
(character(1)
)
Name of the column for event time if data is right censored, otherwise starting time if
interval censored.
event
(character(1)
)
Name of the column giving the event indicator.
If data is right censored then "0"/FALSE
means alive (no event), "1"/TRUE
means dead
(event). If type
is "interval"
then "0" means right censored, "1" means dead (event),
"2" means left censored, and "3" means interval censored. If type
is "interval2"
then
event
is ignored.
time2
(character(1)
)
Name of the column for ending time for interval censored data, otherwise ignored.
type
(character(1)
)
Name of the column giving the type of censoring. Default is 'right' censoring.
Method truth()
True response for specified row_ids
. Format depends on the task type.
Defaults to all rows with role "use".
Usage
TaskSurv$truth(rows = NULL)
Arguments
rows
integer()
Row indices.
Returns
numeric()
.
Method formula()
Creates a formula for survival models with survival::Surv on the LHS.
Usage
TaskSurv$formula(rhs = NULL)
Arguments
rhs
If NULL
RHS is .
, otherwise gives RHS of formula.
Returns
numeric()
.
Method clone()
The objects of this class are cloneable with this method.
Usage
TaskSurv$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.