sgb_label: Labels for xgboost

Description Usage Arguments Examples

View source: R/sgboost.R

Description

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.

Usage

1
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

1
2
3
4
sgb_label(
  time = c(1,2,3),
  status = c(1,0,1)
)

bcjaeger/xgboost.surv documentation built on Nov. 18, 2019, 6:43 a.m.