Displaying 1 result from an estimated 1 matches for "indtrain".
2011 Jul 07
0
Can't reproduce ada example
...R Package for
Stochastic Boosting Journal of Statistical Software, 16
They build and display a boosting model with the code:
library("ada")
n <- 12000
p <- 10
set.seed(100)
x <- matrix(rnorm(n*p), ncol=p)
y <- as.factor(c(-1,1)[as.numeric(apply(x^2, 1, sum) > 9.34) + 1])
indtrain <- sample(1:n, 2000, FALSE)
train <- data.frame(y=y[indtrain], x[indtrain,])
test <- data.frame(y=y[-indtrain], x[-indtrain,])
control <- rpart.control(cp = -1,minsplit = 0,xval = 0,maxdepth = 1)
gdis <- ada(y~., data = train, iter = 400, bag.frac = 1, nu = 1,
control = control, test...