Description Usage Arguments Value Author(s) References
Fit a bayesian additive regression tree(BART) model for classification
1 2 3 4 5 |
X |
training samples by features matrix |
y |
response, factor with level 0,1 |
x.test |
testing samples by feature matrix |
cutoff |
label = 1 if p>cutoff; else label = 0. |
k, power, base |
see ?BART::pbart |
binaryOffset |
The model is P(Y=1 | x) = F(f(x) + binaryOffset). |
p_split |
choice of 'CGM', 'RS'. 'CGM' splits an internal node with probability base*(1+d)^(-power); 'RS': r^(-d), 2 <= r <= n. d is the depth of an internal node. |
r |
'RS' splits an internal node with probability r^(-d), 2 <= r <= n. d is the depth of an internal node. |
ntree |
number of trees |
nskip, ndpost |
number of burn-in and posterior draws |
Tmin |
minimum number of samples in a leaf node allowed |
printevery |
print progress for every 'printevery' iterations |
p_modify |
proportion of three moves: grow, prune, change. |
save_trees |
whether save all the trees from each iteration as a list |
rule |
The splitting rule of an internal node. Choices are: 1. "grp": Gaussian random projection, randomly draw a length p vector from standard normal as the linear combination coefficients of p variables; 2. sgrp: sparse Gaussian random projection, which generates sparse linear combination coefficients; 3. bart: originla bart splits, which are axis-aligned splits; 4. hyperplane: randomly connect two points from the node as the partiton of node space. |
pre_train |
whether pre-train the BART model using 'bart' rule before switching to another splitting rule. |
n_pre_train |
number of iterations of pre-train |
BARTr returns a list of the following elements.
yhat.train |
A matrix with ndpost rows and nrow(X) columns. |
yhat.test |
A matrix with ndpost rows and nrow(x.test) columns. |
yhat.train.mean |
Posterior mean of MCMC draws of traning data fits |
yhat.test.mean |
Posterior mean of MCMC draws of testing data fits |
sigma |
draws of random error vairaince, length = nskip+ndpost |
tree_history |
If save_trees = TRUE, then a list of all trees |
tree_proposal_total |
A ntree by length(p_modify) matrix, the (i,j)th entry is the total number of jth proposal of ith tree |
tree_proposal_accept |
A ntree by length(p_modify) matrix, the (i,j)th entry is the total number of accepted jth proposal of ith tree |
tree_leaf_count |
Number of leaf nodes in each tree |
Dongyue Xie: dongyxie@gmail.com
Chipman, H., George, E., and McCulloch R. (2010) Bayesian Additive Regression Trees. The Annals of Applied Statistics, 4,1, 266-298 <doi:10.1214/09-AOAS285>.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.