search for: testset

Displaying 20 results from an estimated 73 matches for "testset".

Did you mean: testet
2013 Jan 08
0
bagging SVM Ensemble
...part -------------- #SINGLE SVM library(colorspace) library(rpart) library(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])...
2009 Aug 03
2
Truncating based on attribute range and serial no
...6, 76, 66, 70, 14, 7, 3, 62, 62, 30, 10, 7, 53, 44, 29, 46, 47, 15, 13, 84, 77, 26) SerialNo<-c(001147, 005979, 005979, 006128, 006128, 007004, 007004, 007004, 007004, 007004, 007438, 007438,009402,009402, 009402, 012693, 012693, 012693, 014063,014063, 014063, 014063, 014811, 014811,016570) TestSet<-cbind(Age,SerialNo) TestSet<-data.frame(TestSet) I am looking to create a third column titled "IsHead". This column would be either TRUE or FALSE depending on whether the Age variable was the greatest for that set of SerialNo's. So for the above i would return: Age Seria...
2011 Jan 24
5
Train error:: subscript out of bonds
...d to 357 following code produced result only for 8 iterations and for 9th iteration it reaches to an error that ?subscript out of bonds? error. I don?t understand why Any help would be great thanks ####### for (i in 1:10) { fit1<-NULL; x<-NULL; x<-which(number==i) trainset<-d[-x,] testset<-d[x,] train1<-trainset[,-ncol(trainset)] train1<-train1[,-(1)] test_t<-testset[,-ncol(testset)] species_test<-as.factor(testset[,ncol(testset)]) test_t<-test_t[,-(1)] #### #CARET::TRAIN #### fit1<-train(train1,as.factor(trainset[,ncol(trainset)]),"svmpoly",...
2012 Nov 20
3
data after write() is off by 1 ?
...ariables: $ label : Factor w/ 10 levels "0","1","2","3",..: 2 1 2 5 1 1 8 4 6 4 ... $ pixel0 : int 0 0 0 0 0 0 0 0 0 0 ... $ pixel1 : int 0 0 0 0 0 0 0 0 0 0 ... $ pixel2 : int 0 0 0 0 0 0 0 0 0 0 ... [list output truncated] # I make a sampling testset and trainset > index <- 1:nrow(dataset) > testindex <- sample(index, trunc(length(index)*30/100)) > testset <- dataset[testindex,] > trainset <- dataset[-testindex,] # build model, predict, view > model <- svm(label~., data = trainset, type="C-classification&quo...
2012 Dec 02
2
How to re-combine values based on an index?
I am able to split my df into two like so: dataset <- trainset index <- 1:nrow(dataset) testindex <- sample(index, trunc(length(index)*30/100)) trainset <- dataset[-testindex,] testset <- dataset[testindex,-1] So I have the index information, how could I re-combine the data using that back into a single df? I tried what I thought might work, but failed with: newdataset[testindex] = testset[testindex] object 'dataset' not found newdataset[-testindex] = trainset[-te...
2018 Feb 09
1
self-heal trouble after changing arbiter brick
Hi Karthik, Thank you very much, you made me much more relaxed. Below is getfattr output for a file from all the bricks: root at gv2 ~ # getfattr -d -e hex -m . /data/glusterfs/testset/306/30677af808ad578916f54783904e6342.pack getfattr: Removing leading '/' from absolute path names # file: data/glusterfs/testset/306/30677af808ad578916f54783904e6342.pack trusted.afr.dirty=0x000000000000000000000000 trusted.afr.myvol-client-6=0x000000010000000100000000 trusted.bit-rot.versi...
2004 Dec 20
3
Sweave and LaTeX beamer class
...man} \begin{document} \frame{ \frametitle{test} test <<>>= 1+1 @ } \end{document} ################################# Below is the error code: ################################# loading : Context Support Macros / PDF (2004.10.26) ) (d:\programme\texmf\tex\latex\hyperref\nameref.sty) (testset.out) (testset.out) (testset.nav) (d:\programme\texmf\tex\latex\ae\t1aett.fd) Runaway argument? > 1 + 1 \end {Sinput} \begin {Soutput} [1] 2 \end {Soutput} \end {Sch\ETC. ! Paragraph ended before \FV at BeginScanning was complete. <to be read again> \par l.26 } ? x No...
2018 Feb 09
0
self-heal trouble after changing arbiter brick
...: # grep -c gfid heal-info.fpack 80578 # grep -v gfid heal-info.myvol Brick gv0:/data/glusterfs Status: Connected Number of entries: 0 Brick gv1:/data/glusterfs Status: Connected Number of entries: 0 Brick gv4:/data/gv01-arbiter Status: Connected Number of entries: 0 Brick gv2:/data/glusterfs /testset/13f/13f27c303b3cb5e23ee647d8285a4a6d.pack /testset/05c - Possibly undergoing heal /testset/b99 - Possibly undergoing heal /testset/dd7 - Possibly undergoing heal /testset/0b8 - Possibly undergoing heal /testset/f21 - Possibly undergoing heal ... And here is the getfattr output for a sample fi...
2020 Oct 27
3
R for-loop to add layer to lattice plot
...mean = 0.75, sd = 0.15) df = data.frame(x = c(x1,x2), y=c(y1,y2), z=c(rep(0, length(x1)), rep(1, length(x2)))) df$z = factor(c(rep(0, length(x1)), rep(1, length(x2)))) df[, "train"] <- ifelse(runif(nrow(df)) < 0.8, 1, 0) trainset <- df[df$train == 1, ] testset <- df[df$train == 0, ] trainColNum <- grep("train", names(df)) trainset <- trainset[, -trainColNum] testset <- testset[, -trainColNum] svm_model <- svm(z ~ ., data = trainset, type = "C-classification",...
2009 May 15
3
Using sample to create Training and Test sets
...I want to create a training set using whats left over. Example code: acc <- read.table("accOUT.txt", header=T, sep = ",", row.names=1) #select 400 random rows in data training <- acc[sample(1:nrow(acc), 400, replace=TRUE),] #try to get whats left of acc not in training testset <- acc[-training, ] Fails with the following error.... Error: invalid subscript type In addition: Warning message: - not meaningful for factors in: Ops.factor(left) I then try. testset <- acc[!training, ] Which gives me the warning message ! not meaningful for factors in: Ops.factor(left) An...
2009 Mar 11
1
prediction error for test set-cross validation
...t + MaMG + MaMrp + MaSh + SCTub + SCFoc + MaSz, family=binomial(link=logit)); Where the variables are taken from the trainSet of size 1989x31. The test set is sized 222x31. Now my question is when I try to predict on the test set it gives me the error: > predict.glm(model, testSet, type ="response") "Error in drop(X[, piv, drop = FALSE] %*% beta[piv]) : subscript out of bounds" It does fine on trainSet. so it is something about the testSet. On the other hand, I realized that some independent variables say "MaSz" takes 3 different values...
2010 Nov 23
5
cross validation using e1071:SVM
...o this? As I wanted to check my result based on Accuracy and Kappa value generated by caret:confusionMatrix. ########################################## Code ######################################### x<-NULL index<-cvsegments(nrow(data),10) for(i in 1:length(index)) { x<-matrix(index[i]) testset<-data[x[[1]],] trainset<-data[-x[[1]],] species<-as.factor(trainset[,ncol(trainset)]) train1<-trainset[,-ncol(trainset)] train1<-train1[,-(1)] test_t<-testset[,-ncol(testset)] species_test<-as.factor(testset[,ncol(testset)]) test_t<-test_t[,-(1)] model_true1 <-...
2009 Sep 24
3
pipe data from plot(). was: ROCR.plot methods, cross validation averaging
...try whose length = 2, ROCR errors out. Please see the second part of my example. Any suggestions? #reproducible examples exemplifying my questions ##part one## library(ROCR) data(ROCR.xval) # set up data so it looks more like my real data sampSize <- c(4, 55, 20, 75, 350, 250, 6, 120, 200, 25) testSet <- ROCR.xval # do the extraction for (i in 1:length(ROCR.xval[[1]])){ y <- sample(c(1:350),sampSize[i]) testSet$predictions[[i]] <- ROCR.xval$predictions[[i]][y] testSet$labels[[i]] <- ROCR.xval$labels[[i]][y] } # now massage the data using ROCR, set up for a ROC plot # if it...
2020 Oct 23
5
How to shade area between lines in ggplot2
...= rnorm(100, mean = 0.75, sd = 0.1) df = data.frame(x = c(x1,x2), y=c(y1,y2), z=c(rep(0, length(x1)), rep(1, length(x2)))) df$z = factor(c(rep(0, length(x1)), rep(1, length(x2)))) df[, "train"] <- ifelse(runif(nrow(df)) < 0.8, 1, 0) trainset <- df[df$train == 1, ] testset <- df[df$train == 0, ] trainColNum <- grep("train", names(df)) trainset <- trainset[, -trainColNum] testset <- testset[, -trainColNum] head(trainset); str(df) svm_model<- svm(z ~ ., data = trainset, type = "C-classification",...
2018 Feb 08
5
self-heal trouble after changing arbiter brick
Hi folks, I'm troubled moving an arbiter brick to another server because of I/O load issues. My setup is as follows: # gluster volume info Volume Name: myvol Type: Distributed-Replicate Volume ID: 43ba517a-ac09-461e-99da-a197759a7dc8 Status: Started Snapshot Count: 0 Number of Bricks: 3 x (2 + 1) = 9 Transport-type: tcp Bricks: Brick1: gv0:/data/glusterfs Brick2: gv1:/data/glusterfs Brick3:
2020 Oct 28
0
R for-loop to add layer to lattice plot
...df = data.frame(x = c(x1,x2), y=c(y1,y2), > z=c(rep(0, length(x1)), rep(1, length(x2)))) > df$z = factor(c(rep(0, length(x1)), rep(1, length(x2)))) > df[, "train"] <- ifelse(runif(nrow(df)) < 0.8, 1, 0) > trainset <- df[df$train == 1, ] > testset <- df[df$train == 0, ] > trainColNum <- grep("train", names(df)) > trainset <- trainset[, -trainColNum] > testset <- testset[, -trainColNum] > svm_model <- svm(z ~ ., > data = trainset, > type = "C-classific...
2011 Feb 27
2
regularized dfa rda (Klar): problems with predictions
...test/validation sample. The exmaples of the R documantation and some online webpage also do not work. Does anybody know what I have done wrong? Here my code # I want to use the first 6 observations for validationg the model, case 7 to 36 are # used for the trianing: n_fold<-sample(1:36,36) testset<- n_fold[1:6] trainset<- n_fold[-(1:6)] # regularized DFA with default setting (works fine) z <- rda(group ~ ., data=test[trainset,]) #Now the prediction: a<-predict(z,data=test[testset,])$class Error in predict.rda(z, data = test[testset, ]) : A new data to predict must be suppl...
2011 Oct 19
0
R classification
...nd Naïve Bayes" according to their Predicting accuracy, interpretability, scalability, and time consuming etc. I have faced a problem when I am writing the classification table using R The problem is facing me at the last command. The error is : " tab <- table(pred = prediction, true = testset[,7]) Error in table(pred = prediction, true = testset[, 7]) : all arguments must have the same length" can you explain me the error please. When I apply the code at iris data it works perfect. But when I use fish data at rrcov library I am facing this error. Thanx a lot in advanced Moham...
2012 Sep 27
1
Random Forest - Extract
Hello, I have two Random Forest (RF) related questions. 1. How do I view the classifications for the detail data of my training data (aka trainset) that I used to build the model? I know there is an object called predicted which I believe is a vector. To view the detail for my testset I use the below-bind the columns together. I was trying to do something similar for my trainset but without putting it through the predict function. Instead taking directly from the randomForest which I stored in FOREST_model. I really need to get to this information to do some comparison of certa...
2020 Oct 23
0
How to shade area between lines in ggplot2
...0.75, sd = 0.1) > df = data.frame(x = c(x1,x2), y=c(y1,y2), > z=c(rep(0, length(x1)), rep(1, length(x2)))) df$z = factor(c(rep(0, > length(x1)), rep(1, length(x2)))) df[, "train"] <- ifelse(runif(nrow(df)) < 0.8, 1, 0) > trainset <- df[df$train == 1, ] testset <- df[df$train == 0, ] trainColNum <- > grep("train", names(df)) trainset <- trainset[, -trainColNum] testset <- testset[, > -trainColNum] head(trainset); str(df) > > svm_model<- svm(z ~ ., > data = trainset, > type = &quot...