Skip to content

Instantly share code, notes, and snippets.

@grantbrown
Created July 29, 2019 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantbrown/bf6beab5dae343bad63bc7b24f9fa694 to your computer and use it in GitHub Desktop.
Save grantbrown/bf6beab5dae343bad63bc7b24f9fa694 to your computer and use it in GitHub Desktop.
library("XBART")
data(iris)
y <- matrix(0, nrow = nrow(iris), ncol = 3)
for (i in 1:nrow(iris)){
y[i, as.numeric(iris$Species)[i]] <- 1
}
X <- model.matrix(~.-Species-1, data = iris)
num_trees <- 100
num_sweeps <- 100
max_depth <- 10
rslt <- XBART.Probit(y = y, X = X, Xtest =X,
num_trees = num_trees,
num_sweeps = num_sweeps,
max_depth = 10,
Nmin = 2,
num_cutpoints = 10,
alpha = 1,
beta = 1,
tau = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment