train.ada: train.ada

Description Usage Arguments Value Note See Also Examples

View source: R/train.R

Description

Provides a wrapping function for the ada.

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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
confusion.matrix(data.test, prediccion)

PROMiDAT/trainR documentation built on Oct. 27, 2020, 8:33 p.m.