BARTMachineModel: Bayesian Additive Regression Trees Model

Description Usage Arguments Details Value See Also Examples

View source: R/ML_BARTMachineModel.R

Description

Builds a BART model for regression or classification.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
BARTMachineModel(
  num_trees = 50,
  num_burn = 250,
  num_iter = 1000,
  alpha = 0.95,
  beta = 2,
  k = 2,
  q = 0.9,
  nu = 3,
  mh_prob_steps = c(2.5, 2.5, 4)/9,
  verbose = FALSE,
  ...
)

Arguments

num_trees

number of trees to be grown in the sum-of-trees model.

num_burn

number of MCMC samples to be discarded as "burn-in".

num_iter

number of MCMC samples to draw from the posterior distribution.

alpha, beta

base and power hyperparameters in tree prior for whether a node is nonterminal or not.

k

regression prior probability that E(Y|X) is contained in the interval (y_{min}, y_{max}), based on a normal distribution.

q

quantile of the prior on the error variance at which the data-based estimate is placed.

nu

regression degrees of freedom for the inverse X^2 prior.

mh_prob_steps

vector of prior probabilities for proposing changes to the tree structures: (GROW, PRUNE, CHANGE).

verbose

logical indicating whether to print progress information about the algorithm.

...

additional arguments to bartMachine.

Details

Response Types:

binary, numeric

Automatic Tuning of Grid Parameters:

alpha, beta, k, nu

Further model details can be found in the source link below.

In calls to varimp for BARTMachineModel, argument metric may be spedified as "splits" (default) for the proportion of time each predictor is chosen for a splitting rule or as "trees" for the proportion of times each predictor appears in a tree. Argument num_replicates is also available to control the number of BART replicates used in estimating the inclusion proportions [default: 5]. Variable importance is automatically scaled to range from 0 to 100. To obtain unscaled importance values, set scale = FALSE. See example below.

Value

MLModel class object.

See Also

bartMachine, fit, resample

Examples

1
2
model_fit <- fit(sale_amount ~ ., data = ICHomes, model = BARTMachineModel)
varimp(model_fit, metric = "splits", num_replicates = 20, scale = FALSE)

brian-j-smith/MachineShop documentation built on March 15, 2020, 11:24 a.m.