search for: trainindex

Displaying 4 results from an estimated 4 matches for "trainindex".

2011 Nov 30
1
glm step() fkt
...i have a question about the step() fkt. Is there a possibility to save the last model generated from this method. I have a loop and so i generate 100 different models with the step fkt and i want to know which model is the most common. CODE: ... missStep -> numeric(100) for (j in 1:100) { trainindex <- sample(c(1:462),300) train <- data[trainindex,] test <- data[-trainindex,] mod.step <- step(mod, direction="both",trace=T) } ... So i want to store each iteration the best model. Thx in advanced people, greetings -- View this message in c...
2018 Apr 14
2
Efficient way to subset rows in R for dataset with 10^7 columns
I have a data.table with dimensions 100 by 10^7. When I do trainIndex <- caret::createDataPartition( df$status, p = .9, list = FALSE, times = 1 ) outerTrain <- df[trainIndex] outerTest <- df[-trainIndex] Subsetting the rows of df takes over 20 minutes. What is the best way to efficiently subset this? Th...
2018 Apr 14
0
Efficient way to subset rows in R for dataset with 10^7 columns
...e 10^7 columns? That process is bound to be slow. >> >> On April 13, 2018 5:31:32 PM PDT, Jack Arnestad ><jackarnestad at gmail.com> >> wrote: >> >I have a data.table with dimensions 100 by 10^7. >> > >> >When I do >> > >> > trainIndex <- >> > caret::createDataPartition( >> > df$status, >> > p = .9, >> > list = FALSE, >> > times = 1 >> > ) >> > outerTrain <- df[trainIndex] >> > outerTest <- df[-trainIndex]...
2013 Jan 08
0
bagging SVM Ensemble
...brary(e1071) library(MASS) dataset <- read.csv("E:/thesis/SVM/hepatitis data csv.csv",header=T,sep=";") attach(dataset) index <- 1:nrow(dataset) testindex <- sample(index, trunc(length(index)*30/100)) testset <- dataset[testindex,] trainset <- dataset[-testindex,] trainindex <- sample(index, trunc(length(index)*70/100)) tuned <- tune.svm(class~., data = trainset, gamma = 10^(-6:-1), cost = 10^(-1:1)) cc <- as.numeric(tuned$best.parameters[2]) gg <- as.numeric(tuned$best.parameters[1]) modelolin <- svm(class ~ ., trainset, type = "C-classification&qu...