computeForestMaxLeafIndex | R Documentation |
computeForestLeafIndices
for the forests in a designated forest sample container.Compute and return the largest possible leaf index computable by computeForestLeafIndices
for the forests in a designated forest sample container.
computeForestMaxLeafIndex(
model_object,
covariates,
forest_type = NULL,
forest_inds = NULL
)
model_object |
Object of type |
covariates |
Covariates to use for prediction. Must have the same dimensions / column types as the data used to train a forest. |
forest_type |
Which forest to use from 1. BART
2. BCF
3. ForestSamples
|
forest_inds |
(Optional) Indices of the forest sample(s) for which to compute max leaf indices. If not provided,
this function will return max leaf indices for every sample of a forest.
This function uses 0-indexing, so the first forest sample corresponds to |
Vector containing the largest possible leaf index computable by computeForestLeafIndices
for the forests in a designated forest sample container.
X <- matrix(runif(10*100), ncol = 10)
y <- -5 + 10*(X[,1] > 0.5) + rnorm(100)
bart_model <- bart(X, y, num_gfr=0, num_mcmc=10)
computeForestMaxLeafIndex(bart_model, X, "mean")
computeForestMaxLeafIndex(bart_model, X, "mean", 0)
computeForestMaxLeafIndex(bart_model, X, "mean", c(1,3,9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.