Description Usage Arguments Value Examples
This function calls ada
with a default control
argument set to
rpart.control(maxdepth=1,cp=-1,minsplit=0,xval=0)
1 |
formula |
formula object describing the model to be fit, as in
|
data |
data.frame object to train the model. The variables named in formula must be present in this object |
... |
Further arguments to be passed to ada function from "ada" package |
An object of class adaStump containing:
model |
a data.frame describing the stumps generated by |
type |
Type of execution performed. It is directly inherited
from the |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #Load Iris
data(iris)
#Create Variable is Iris as numerical
iris$isSetosa <- as.numeric(iris$Species == "setosa")
#Split sample in 70 train - 30 test
train.ind <- sample(nrow(iris), nrow(iris) * 0.7)
#Train model. For obvious reasons, Species variable is not included in the fit
fit <- adaStump(isSetosa ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, iris[train.ind,],
type = "discrete", iter = 10, nu = 0.05, bag.frac = 0.6)
#Prediction
predict(fit,iris[-train.ind,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.