| createForestModel | R Documentation |
Create a forest model object
This function is intended for advanced use cases in which users require detailed control of sampling algorithms and data structures. Minimal input validation and error checks are performed – users are responsible for providing the correct inputs. For tutorials on the "proper" usage of the stochtree's advanced workflow, we provide several vignettes at https://stochtree.ai/
createForestModel(forest_dataset, forest_model_config, global_model_config)
forest_dataset |
ForestDataset object, used to initialize forest sampling data structures |
forest_model_config |
ForestModelConfig object containing forest model parameters and settings |
global_model_config |
GlobalModelConfig object containing global model parameters and settings |
ForestModel object
num_trees <- 100
n <- 100
p <- 10
alpha <- 0.95
beta <- 2.0
min_samples_leaf <- 2
max_depth <- 10
feature_types <- as.integer(rep(0, p))
X <- matrix(runif(n*p), ncol = p)
forest_dataset <- createForestDataset(X)
forest_model_config <- createForestModelConfig(feature_types=feature_types,
num_trees=num_trees, num_features=p,
num_observations=n, alpha=alpha, beta=beta,
min_samples_leaf=min_samples_leaf,
max_depth=max_depth, leaf_model_type=1)
global_model_config <- createGlobalModelConfig(global_error_variance=1.0)
forest_model <- createForestModel(forest_dataset, forest_model_config, global_model_config)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.