| cuda_ml_rand_forest | R Documentation |
Trains a cuML random forest for classification or regression and returns an nvForest-backed model for inference.
cuda_ml_rand_forest(x, ...)
## Default S3 method:
cuda_ml_rand_forest(x, ...)
## S3 method for class 'data.frame'
cuda_ml_rand_forest(
x,
y,
mtry = NULL,
trees = 100L,
min_n = 2L,
bootstrap = TRUE,
sample_fraction = 1,
max_depth = 16L,
max_leaves = Inf,
n_bins = 128L,
min_samples_leaf = 1L,
split_criterion = NULL,
min_impurity_decrease = 0,
max_batch_size = 4096L,
n_streams = 4L,
seed = NULL,
...
)
## S3 method for class 'matrix'
cuda_ml_rand_forest(
x,
y,
mtry = NULL,
trees = 100L,
min_n = 2L,
bootstrap = TRUE,
sample_fraction = 1,
max_depth = 16L,
max_leaves = Inf,
n_bins = 128L,
min_samples_leaf = 1L,
split_criterion = NULL,
min_impurity_decrease = 0,
max_batch_size = 4096L,
n_streams = 4L,
seed = NULL,
...
)
## S3 method for class 'formula'
cuda_ml_rand_forest(
formula,
data,
mtry = NULL,
trees = 100L,
min_n = 2L,
bootstrap = TRUE,
sample_fraction = 1,
max_depth = 16L,
max_leaves = Inf,
n_bins = 128L,
min_samples_leaf = 1L,
split_criterion = NULL,
min_impurity_decrease = 0,
max_batch_size = 4096L,
n_streams = 4L,
seed = NULL,
...
)
## S3 method for class 'recipe'
cuda_ml_rand_forest(
x,
data,
mtry = NULL,
trees = 100L,
min_n = 2L,
bootstrap = TRUE,
sample_fraction = 1,
max_depth = 16L,
max_leaves = Inf,
n_bins = 128L,
min_samples_leaf = 1L,
split_criterion = NULL,
min_impurity_decrease = 0,
max_batch_size = 4096L,
n_streams = 4L,
seed = NULL,
...
)
x |
Depending on the context:
|
... |
Optional arguments; currently unused. |
y |
A numeric vector (for regression) or factor (for classification) of desired responses. |
mtry |
Number of predictors sampled at each split. When |
trees |
Number of trees. Default: 100L. |
min_n |
Minimum observations required to split a node. Default: 2L. |
bootstrap |
Whether to sample observations with replacement. |
sample_fraction |
Proportion of rows used for each tree, between
0 and 1. This is separate from |
max_depth |
Maximum tree depth. Default: 16L. |
max_leaves |
Maximum leaves per tree, or |
n_bins |
Number of candidate split bins. Default: 128L. |
min_samples_leaf |
Minimum observations in a leaf. Default: 1L. |
split_criterion |
Split criterion, or |
min_impurity_decrease |
Minimum impurity decrease required for a split. |
max_batch_size |
Maximum nodes processed in one batch. Default: 4096L. |
n_streams |
Number of CUDA streams used while fitting. Default: 4L. |
seed |
Random seed forwarded to cuML. When |
formula |
A formula specifying the outcome terms on the left-hand side, and the predictor terms on the right-hand side. |
data |
When a recipe or formula is used, |
A random forest model for use with predict().
Training uses cuML and requires the complete GPU backend installed by
cuda_ml_install(). Persist the fitted model with
cuda_ml_serialize(); the current state is device neutral. A
host without a GPU can install the separate CPU inference backend with
cuda_ml_install(device = "cpu") and restore the state with
cuda_ml_unserialize(state, device = "cpu"). The CPU backend is
roughly 3 MiB installed and does not include cuML or the complete managed
CUDA and RAPIDS runtime. To create an independently usable Treelite
checkpoint and a cuda.ml JSON sidecar instead, use
cuda_ml_nvforest_export() and
cuda_ml_nvforest_import().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.