R/mtry_finder.R

Defines functions mtry_finder

Documented in mtry_finder

#' Calculate mtry for randomForest
#'
#' Calculates mtry, the number of variables to try at each split, from
#' a \code{data.frame} for \code{randomForest}.
#'
#' @param df \code{data.frame}
#'
#' @return Single numeric value for mtry
#'
#' @examples
#' data(iris)
#' mtry <- mtry_finder(iris)
#'
#' @export
mtry_finder <- function(df) sqrt(length(df) - 1)
amorris28/amorris documentation built on Nov. 24, 2022, 6:39 a.m.