This learner implements Bayesian Additive Regression Trees via bartMachine (described in Kapelner and Bleich (2016) ) and the function bartMachine.

Format

An R6Class object inheriting from Lrnr_base.

Value

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner functionality, see the complete documentation of Lrnr_base.

Parameters

  • ...: Parameters passed to bartMachine. See it's documentation for details.

References

Kapelner A, Bleich J (2016). “bartMachine: Machine Learning with Bayesian Additive Regression Trees.” Journal of Statistical Software, 70(4), 1--40. doi:10.18637/jss.v070.i04 .

Examples

# set up ML task
data(cpp_imputed)
covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")

# fit a bartMachine model and predict from it
bartMachine_learner <- make_learner(Lrnr_bartMachine)
#> Warning: User did not specify Java RAM option, and this learner often fails with the default RAM of 500MB,
#> so setting that now as `options(java.parameters = '-Xmx2500m')`.
#> 
#> Note that Xmx parameter's upper limit is system dependent 
#> (e.g., 32bit Windows will fail to work with anything much largerthan 1500m), 
#> so ideally this option should be specified by the user.
bartMachine_fit <- bartMachine_learner$train(task)
preds <- bartMachine_fit$predict()