bestEAT: Tuning an Efficiency Analysis Trees model

Description Usage Arguments Value Examples

View source: R/bestModels.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bestEAT(
  training,
  test,
  x,
  y,
  numStop = 5,
  fold = 5,
  max.depth = NULL,
  max.leaves = NULL,
  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.

fold

Folds in which the dataset to apply cross-validation during the pruning is divided.

max.depth

Maximum depth of the tree.

max.leaves

Maximum number of leaf nodes.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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

bestEAT(training = training, 
        test = test,
        x = 6:9,
        y = 3,
        numStop = c(3, 5, 7),
        fold = c(5, 7, 10))

MiriamEsteve/EAT documentation built on Jan. 18, 2022, 6:55 p.m.