suggest_mtries: Suggest Alternative mtries Values

View source: R/suggest_mtries.R

suggest_mtriesR Documentation

Suggest Alternative mtries Values

Description

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.

Usage

suggest_mtries(p, family = c("classification", "regression"))

Arguments

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.

Details

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.

Value

An integer vector of candidate values for mtries.

Author(s)

E. F. Haghish

Examples

## 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)


HMDA documentation built on April 4, 2025, 6:06 a.m.