adaStump: Fit an ada boosting model with decision stumps as base...

Description Usage Arguments Value Examples

View source: R/adaStump.R

Description

This function calls ada with a default control argument set to rpart.control(maxdepth=1,cp=-1,minsplit=0,xval=0)

Usage

1

Arguments

formula

formula object describing the model to be fit, as in ada function from "ada" package.

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

Value

An object of class adaStump containing:

model

a data.frame describing the stumps generated by ada. The object is normally considerably smaller than the equivalent ada object

type

Type of execution performed. It is directly inherited from the adaStump call

Examples

 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,])

nivangio/adaStump documentation built on May 23, 2019, 7:06 p.m.