rlt_reg: Fit a RLT model and compute predictions of expectations for...

Description Usage Arguments Details Value References See Also

View source: R/rlt_reg.R

Description

rlt_reg is a benchmark model we use in [Gerber et al. (2018)]. To model the variable phi(T), where T is a right censored time and phi is a given function, we first fit a RLT (Reinforcement Learning Trees) model to the data to estimate the survival function of T given the covariates. Then, we deduce an estimator of phi(T) by integration of the function phi with respect to the estimated survival function. Different methods are available to assess the quality of fit of rlt_reg. rlt_reg is a wrapper for the RLT function

The notations we use are :

Usage

1
2
3
4
5
6
rlt_reg(y_var, delta_var, x_vars, train, test = NULL, phi = function(x) {   
   x }, phi.args = list(), max_time = NULL, rlt_obj = T,
  ev_methods = c("concordance", "weighted"), bandwidths = NULL,
  types_w_ev = c("KM"), max_w_ev = 20, mat_w = NULL,
  y_no_cens_var = NULL, ntree = 100, minleaf = 5, maxdepth = 6,
  mtry = NULL, reinforcement = T, ...)

Arguments

y_var

A character string which gives the name of the Y variable

delta_var

A character string which gives the name of the δ variable (this variable should be binary : 1 = non censored, 0 = censored)

x_vars

A vector of character strings which gives the names of the explanatory variables

train

A data.frame of training observations. It must contain the column names y_var, delta_var and x_vars

test

A data.frame of testing observations (default = NULL)

phi

A function to be applied to y_var

phi.args

A list of additional parameters for the function phi (default = NULL). See Examples for a use case

max_time

A real number giving a threshold for y_var (default = NULL). If NULL, then max_time is set to the maximum non censored observation of y_var among the training set. We note T' = min(T, max_time)

rlt_obj

A boolean which indicates if the RLT model fitted to the training data should be returned (default = TRUE)

ev_methods

A vector of character strings which gives the methods that should be used for the evaluation of the model (default = c("concordance","weighted")). Possible choices are "concordance", "weighted" and "group". Multiple choices are possible. See Details - Evaluation criteria for more information

bandwidths

A vector of real numbers for the bandwidths to use for the model evaluation if "group" is used as an ev_methods (default = NULL : set to 50 if "group" in ev_methods). Only used if "group" is used as ev_methods. See Details - Evaluation criteria for more information

types_w_ev

A vector of character strings which gives the types of weights to be used for IPCW (Inverse Probability of Censoring Weighting) in the model evaluation (default = c("KM") (Kaplan Meier)). Possible choices are "KM", "Cox", "RSF" and "unif". Set to colnames(mat_w) if mat_w is provided. See Details - Evaluation criteria for more information

max_w_ev

A real number which gives the maximum admissible ratio for the IPC weights (default = 1000). See Details - Evaluation criteria for more information

mat_w

A matrix to provide handmade IPC weights for the model evaluation (default = NULL). mat_w should satisfied nrow(mat_w) = nrow(train) + nrow(test) and a column should correspond to a type of weights (multiple columns are possible). Column names of mat_w may be used to specify names for the provided weights (by default names will be "w1", "w2", ...)

y_no_cens_var

A character string which gives the name of the non censored y_var (default = NULL). To be used only in the context of simulated data where full about is available.

ntree

A positive integer which gives the number of trees to grow in the forest (default = 100).

minleaf

A positive integer indicating the minimum number of observations that must be present in a (terminal) leaf (default = 5).

maxdepth

A positive integer indicating the maximum number of layers in individual trees (default = 6).

mtry

A positive integer indicating the number of random variables to draw at each node for the split selection (default = NULL). If NULL, mtry is set to floor(sqrt(length(x_vars))) by default.

reinforcement

A boolean which specifies if reinforcement in RLT shloud be used for split selection

...

Additional parameter that may be pass to the RLT function (package RLT)

Details

Value

A list with the following elements :

pred_train

The vector of the predicted values for phi(T') (with T' = min(T, max_time)) for the observations of the train set

pred_test

The vector of the predicted values for phi(T') for the observations of the test set (require test != NULL)

perf_train

The list with the values for the evaluation criteria computed on the train set

perf_test

The list with the values for the evaluation criteria computed on the test set (require test != NULL))

surv_train

The matrix which contains the estimated values of the survival curves at time_points (with the Cox model), for the observations of the train set

surv_test

The matrix which contains the estimated values of the survival curves at time_points, for the observations of the test set (require test != NULL)

time_points

The vector of the time points where the survival curves are evaluated

mat_w_train

The matrix which contains the values of the weights used for the "weighted" criteria, for the observations of the train set

mat_w_test

The matrix which contains the values of the weights used for the "weighted" criteria, for the observations of the test set

n_w_ev_modif_train

The vector giving the number of train weights modified due to max_w_ev

n_w_ev_modif_test

The vector giving the number of test weights modified due to max_w_ev

rlt_obj

The obj returned by the RLT function

max_time

The real number giving the threshold used by the model

cens_rate

The real number giving the rate of censoring of T', computed on the concatenation of train and test

train

The data.frame of the train data provided as arguments, plus columns : Y' = min(Y, max_time ), δ' = 1_{T' ≤ C} and phi(T')

test

The data.frame of the test data provided as arguments, plus columns : Y' = min(Y, max_time ), δ' = 1_{T' ≤ C} and phi(T')

phi

See Argument

phi.args

See Argument

x_vars

See Argument

max_w_ev

See Argument

References

Gerber, G., Le Faou, Y., Lopez, O., & Trupin, M. (2018). The impact of churn on prospect value in health insurance, evaluation using a random forest under random censoring. https://hal.archives-ouvertes.fr/hal-01807623/

See Also

RLT, predict_rlt_reg


YohannLeFaou/sword documentation built on May 28, 2019, 3:21 p.m.