knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

eat

The EAT algorithm performs a regression tree based on CART methodology under a new approach that guarantees obtaining a frontier as estimator that fulfills the property of free disposability. This new technique has been baptized as Efficiency Analysis Trees. Some of its main functions are:

Installation

You can install the released version of eat from CRAN with:

install.packages("eat")

And the development version from GitHub with:

devtools::install_github("MiriamEsteve/EAT")

Example

library(eat)
data("PISAindex")
single_model <- EAT(data = PISAindex, 
                    x = 15, # input 
                    y = 3) # output
print(single_model)
summary(single_model)
EAT_size(single_model)
EAT_frontier_levels(single_model)
EAT_leaf_stats(single_model)
frontier(object = single_model,
         FDH = TRUE, 
         observed.data = TRUE,
         rwn = TRUE)
multioutput <- EAT(data = PISAindex, 
                   x = 6:18,
                   y = 3:5)
rankingEAT(object = multioutput,
           barplot = TRUE,
           threshold = 70,
           digits = 2)
plotEAT(object = multioutput)
n <- nrow(PISAindex) # Observations in the dataset
t_index <- sample(1:n, n * 0.7) # Training indexes
training <- PISAindex[t_index, ] # Training set
test <- PISAindex[-t_index, ] # Test set

bestEAT(training = training, 
        test = test,
        x = 6:18,
        y = 3:5,
        numStop = c(5, 7, 10),
        fold = c(5, 7))
single_model <- EAT(data = PISAindex, x = 15, y = 3)

scores_EAT <-  efficiencyEAT(data = PISAindex,
                            x = 15, 
                            y = 3,
                            object = single_model, 
                            scores_model = "BCC.OUT",
                            digits = 3,
                            FDH = TRUE,
                            print.table = TRUE)
scores_CEAT <- efficiencyCEAT(data = PISAindex,
                              x = 15, 
                              y = 3,
                              object = single_model, 
                              scores_model = "BCC.INP",
                              digits = 3,
                              DEA = TRUE,
                              print.table = TRUE)
efficiencyJitter(object = single_model,
                 df_scores = scores_EAT$EAT_BCC_OUT,
                 scores_model = "BCC.OUT",
                 lwb = 1.2)
efficiencyDensity(df_scores = scores_EAT[, 3:4],
                  model = c("EAT", "FDH"))
forest <- RFEAT(data = PISAindex, 
                x = 6:18, 
                y = 5, 
                numStop = 5, 
                m = 30,
                s_mtry = "BRM",
                na.rm = TRUE)
print(forest)
plotRFEAT(forest)
rankingRFEAT(object = forest, barplot = TRUE,
             digits = 2)
bestRFEAT(training = training, 
          test = test,
          x = 6:18,
          y = 3:5,
          numStop = c(5, 10),
          m = c(30, 40),
          s_mtry = c("BRM", "3"))
efficiencyRFEAT(data = PISAindex,
                x = 6:18,
                y = 5,
                object = forest,
                FDH = TRUE,
                print.table = TRUE)
input <- c(6, 7, 8, 12, 17)
output <- 3:5

EAT_model <- EAT(data = PISAindex, x = input, y = output)
RFEAT_model <- RFEAT(data = PISAindex, x = input, y = output)

# PREDICTIONS
predictions_EAT <- predict(object = EAT_model, newdata = PISAindex[, input])
predictions_RFEAT <- predict(object = RFEAT_model, newdata = PISAindex[, input])

Please, check the vignette for more details.



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