xgboost functions expect a certain type of label vector for certain problem types. For survival models, xgboost labels should be time-to-event values with negative times indicating censored observations and postive times indicating events.

sgb_label(time, status)

Arguments

time

a numeric vector with time-to-event values.

status

a numeric vector of 0s and 1s, where 0 indicates censoring and 1 indicates that the event occurred.

Examples

sgb_label( time = c(1,2,3), status = c(1,0,1) )
#> [1] 1 -2 3