train.ada: train.ada

View source: R/train.R

train.adaR Documentation

train.ada

Description

Provides a wrapping function for the ada.

Usage

train.ada(formula, data, ..., subset, na.action = na.rpart)

Arguments

formula

a symbolic description of the model to be fit.

data

an optional data frame containing the variables in the model.

...

arguments passed to rpart.control. For stumps, use rpart.control(maxdepth=1,cp=-1,minsplit=0,xval=0). maxdepth controls the depth of trees, and cp controls the complexity of trees. The priors should also be fixed through the parms argument as discussed in the second reference.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

na.action

a function that indicates how to process ‘NA’ values. Default=na.rpart.

Value

A object ada.prmdt with additional information to the model that allows to homogenize the results.

Note

the parameter information was taken from the original function ada.

See Also

The internal function is from package ada.

Examples


data("Puromycin")

n <- seq_len(nrow(Puromycin))
.sample <- sample(n, length(n) * 0.75)
data.train <- Puromycin[.sample,]
data.test <- Puromycin[-.sample,]

modelo.ada <- train.ada(state~., data.train)
modelo.ada
prob <- predict(modelo.ada, data.test , type = "prob")
prob
prediccion <- predict(modelo.ada, data.test , type = "class")
prediccion


traineR documentation built on Nov. 10, 2023, 1:15 a.m.

Related to train.ada in traineR...