bestRFEAT: Tuning a Random Forest + Efficiency Analysis Trees model

View source: R/bestModels.R

bestRFEATR Documentation

Tuning a Random Forest + Efficiency Analysis Trees model

Description

This funcion computes the root mean squared error (RMSE) for a set of Random FOrest + Efficiency Analysis Trees models built with a grid of given hyperparameters.

Usage

bestRFEAT(
  training,
  test,
  x,
  y,
  numStop = 5,
  m = 50,
  s_mtry = c("5", "BRM"),
  na.rm = TRUE
)

Arguments

training

Training data.frame or matrix containing the variables for model construction.

test

Test data.frame or matrix containing the variables for model assessment.

x

Column input indexes in training.

y

Column output indexes in training.

numStop

Minimum number of observations in a node for a split to be attempted.

m

Number of trees to be built.

s_mtry

character. Number of inputs to be selected in each split. See “

na.rm

logical. If TRUE, NA rows are omitted.

Value

A data.frame with the sets of hyperparameters and the root mean squared error (RMSE) associated for each model.

Examples


data("PISAindex")

n <- nrow(PISAindex) # Observations in the dataset
selected <- sample(1:n, n * 0.7) # Training indexes
training <- PISAindex[selected, ] # Training set
test <- PISAindex[- selected, ] # Test set

bestRFEAT(training = training, 
          test = test,
          x = 6:9,
          y = 3,
          numStop = c(3, 5),
          m = c(20, 30),
          s_mtry = c("1", "BRM"))



eat documentation built on Jan. 10, 2023, 5:13 p.m.