Boosting Predictions

# S3 method for sgb_booster
predict(object, new_data, eval_times = NULL, ...)

Arguments

object

a sgb_booster object

new_data

data to compute predictions for.

eval_times

numeric vector of times to compute survival probabilities.

...

Additional arguments passed to other functions.

  • smooth: if TRUE, smooth the estimated baseline hazard using Friedman's super smoother supsmu.

  • ntreelimit: limit the number of model's trees or boosting iterations used in prediction. If unspecified, all trees will be used.

Value

a matrix with number of columns equal to the number of eval_times and number of rows equal to the number of rows in new_data. Additionally, eval_times are attached to the output as an attribute.

Examples

x1 <- rnorm(100) x2 <- rnorm(100) s <- as.numeric(x1 + x2 + rnorm(100) > 0) t <- runif(100, min=1, max=10) df = data.frame(time=t, status=s, x1=x1, x2=x2) df = as_sgb_data(df, time=time, status=status) sgb_booster <- sgb_fit( sgb_df = df, params = sgb_params(max_depth=1), nrounds = 10, verbose = FALSE ) sgb_probs <- predict(sgb_booster, new_data = df)