Boosting Predictions
# S3 method for sgb_booster predict(object, new_data, eval_times = NULL, ...)
object | a |
---|---|
new_data | data to compute predictions for. |
eval_times | numeric vector of times to compute survival probabilities. |
... | Additional arguments passed to other functions.
|
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.
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)