rbartpackages.bartMachine

Wrapper for the R package bartMachine (on CRAN).

bartMachine wants data frames, so this module requires the pandas extra.

Importing this module loads bartMachine’s R namespace, which starts the JVM. JVM options can only be set before that: the import defaults the heap size limit to 5 GB and enables the Vector API module bartMachine uses on JDK 16+; to customize, set R’s java.parameters option before the first import.

Model fitting

bartMachine([X, y, Xy, num_trees, ...])

Fit BART to continuous or binary outcomes.

Posterior queries

bart_machine_get_posterior(bart_machine, ...)

Posterior draws of f(x) at the rows of new_data.

get_sigsqs(bart_machine[, after_burn_in, ...])

Posterior draws of the error variance (regression fits only).

Parallelism

bart_machine_num_cores()

Return the number of threads bartMachine uses to fit the model.

set_bart_machine_num_cores(num_cores, *[, ...])

Set the number of threads bartMachine uses to fit the model.

Supporting types

Posterior

Type of bart_machine_get_posterior's return value.