Predicting new observations with previously fitted flexBART model
predict.flexBART.Rdpredict.flexBART() can take the output of flexBART and use it to make predictions at new inputs.
Usage
# S3 method for class 'flexBART'
predict(object, newdata, ...)Details
Make predictions at new inputs based on the output of flexBART.
When the training and/or testing dataset is large, it is recommended to run flexBART with the arguments
save_samples = FALSE and save_trees = TRUE.
Then, to access posterior samples of the function evaluations, pass the fitted “flexBART” object to predict.flexBART()
along with the appropriate newdata argument.
For probit or logistic BART, the function outputs draws of the fitted probabilities.
Value
When there is only one ensemble, a matrix containing posterior samples of the regression function evaluated at the supplied inputs. For models with multiple ensembles, a list with three elements: (i) a matrix containing posterior samples of the regression function evaluation and (ii) an array containing evaluations of the identified slopes; and (iii) an array containing evaluations of all slopes on the standardized scale.