View source: R/suggest_mtries.R
suggest_mtries | R Documentation |
Provides a set of candidate values for the
mtries
parameter used in Random Forest models.
The suggestions are computed based on the number of
predictors (p
) and the modeling family. For
classification, the common default is sqrt(p)
,
while for regression it is typically p/3
. For
family, alternative candidates are offered to aid model
tuning.
suggest_mtries(p, family = c("classification", "regression"))
p |
Integer. The number of features (predictors) in the dataset. This value is used to compute candidate mtries. |
family |
Character. Must be either "classification" or "regression". This determines the set of candidate values. |
For classification, the default is often
sqrt(p)
; alternative suggestions include
log2(p)
and p^(1/3)
. For regression,
the typical default is p/3
, but candidates such as
p/2
or p/5
may also be useful. The best
choice depends on the data structure and predictor
correlations.
An integer vector of candidate values for
mtries
.
E. F. Haghish
## Not run:
# For a classification task with 100 predictors:
suggest_mtries(p = 100, family = "classification")
# For a regression task with 100 predictors:
suggest_mtries(p = 100, family = "regression")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.