| train.ada | R Documentation |
Provides a wrapping function for the ada.
train.ada(formula, data, ..., subset, na.action = na.rpart)
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. |
A object ada.prmdt with additional information to the model that allows to homogenize the results.
the parameter information was taken from the original function ada.
The internal function is from package ada.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.