Displaying 1 result from an estimated 1 matches for "pamgrid".
Did you mean:
mgrid
2012 Apr 06
0
resampling syntax for caret package
...add colnames
myind <- seq(1:ncol(colon.x))
mynames <- paste("A",myind,sep="")
colnames(colon.x) <- mynames
outcome <- factor(as.character(colon.y),levels=c("1","2"))
cv_index <- 1:length(outcome)
predictions <- rep(-1,length(cv_index))
pamGrid <- seq(0.1,5,by=0.2)
pamGrid <- data.frame(.threshold=pamGrid)
# manual leave-one-out
for (holdout in cv_index) {
pamFit1 <- train(colon.x[-holdout,], outcome[-holdout],
method = "pam",
tuneGrid= pamGrid,
trControl = trainContro...