search for: ytrain

Displaying 15 results from an estimated 15 matches for "ytrain".

Did you mean: strain
2007 Oct 23
1
Compute R2 and Q2 in PLS with pls.pcr package
...en for each variable of Y). I have tried to compute it myself from the ouput of mvr but I am not sure if the values of Ypred within the validat slot are the predictions of each observation of Y when leave-one-out cross validation is applied. My code is as follows: > mypls <- mvr(Xtrain, Ytrain, method="SIMPLS", validation="CV", ncomp=1, niter=nrow(Ytrain)) > Xhat <- mypls$training$Xscores %*% t(mypls$training$Xload) > R2 <- 1-(sum((Xhat-Xtrain)^2)/sum(Xtrain^2)) > Q2 <- 1-(sum((Ytrain-mypls$validat$Ypred[,,1])^2)/sum(Ytrain^2) Is this right? T...
2010 Aug 16
0
Help for using nnet in R for NN training and testing
...a total of 2000 observations. The first column in the file is a column just for giving the serial numbers of the observations. I have already read in the file and also extracted the different values into the matrices to use. Please refer to the code below. I want to use 'xtrain' and 'ytrain' to train the data (the 60% of the observations) and I want to simulate the NN with 'xtest' and then compare the predicted Y values from the NN with the 'ytest' to get a value of MSE. ***************************************************************************** data<-read.t...
2005 Jun 23
1
errorest
Hi, I am using errorest function from ipred package. I am hoping to perform "bootstrap 0.632+" and "bootstrap leave one out". According to the manual page for errorest, i use the following command: ce632[i]<-errorest(ytrain ~., data=mydata, model=lda, estimator=c("boot","632plus"), predict=mypredict.lda)$error It didn't work. I then tried the following two commands: ce632[i]<-errorest(ytrain ~., data=mydata, model=lda, estimator=c("632plus"), est.para=control.errorest(nboot=B)...
2011 May 24
1
seeking help on using LARS package
...ction, Jean-Philippe Vert et. al, Bioinformatics" for a Bioinformatics project that we are working on. I know that the authors of the paper are using Lasso regression and so far looking at their paper this is what I have gotten to. xtrain <- trainData > dim(trainData) [1] 18520 88 ytrain <- trainScore length(ytrain) [1] 18520 nfolds <- 100 epsilon <- exp(-10) # code from JP Vert object1 <- cv.lars(xtrain,ytrain, K=nfolds, fraction = seq(from = 0, to = 1 , length= 1000), type='lasso', eps=epsilon, plot.it=TRUE) bestfraction <- object1$fraction[min(which...
2005 Nov 25
3
obtaining a ROC curve
Hello, I have a classification tree. I want to obtain a ROC curve for this test. What is the easiest way to obtain one? -Anjali --------------------------------- [[alternative HTML version deleted]]
2004 Nov 15
0
how to obtain predicted labels for test data using "kernelpls"
...mail to ask you something about the "kernelpls" function in R (pls.pcr package). I would like to obtain the predicted Y values for test data, using the Kernel PLS method. Let's take the example in the R help: > data(NIR) > attach(NIR) > NIR.kernelpls <- mvr(Xtrain, Ytrain, 1:6, validation = "CV", method="kernelPLS") How can we get the predicted Y values ("Ypred") for Xtest in this case? As far as I checked, there is no parameter to specify the test data in "mvr" or "pls". I, therefore, thought about the "ker...
2009 Oct 14
0
Confusion matrix from cross validation in R:
...How do I get the confusion matrix after performing 10-fold cross validation from SVM in R? When I try to print it, I get the confusion matrix without cross validation. I need to compute PPV. Should I report PPV without CV and total accuracy with CV? I am confused. > svmtrain <- svm(xtrain,ytrain,kernel="sigmoid",cross=10) > pred <- predict(svmtrain, xtrain) > table(pred, ytrain) Pam -- View this message in context: http://www.nabble.com/Confusion-matrix-from-cross-validation-in-R%3A-tp25883309p25883309.html Sent from the R help mailing list archive at Nabble.com.
2011 Aug 26
1
kernlab: ksvm() bug?
Hello all, I'm trying to run a gird parameter search for a svm. Therefore I'M using the ksvm function from the kernlab package. ---- svp <- ksvm(Ktrain,ytrain,type="nu-svc",nu=C) ---- The problem is that the optimization algorithm does not return for certain parameters. I tried to use setTimeLimit() but that doesn't seem to help. I suspect that ksvm() calls c code that does not respond to the time limit. I don't know what else to try...
2004 Nov 15
0
how to obtain predicted labels for test data using "kerne lpls"
...ut the "kernelpls" function in R (pls.pcr package). > > I would like to obtain the predicted Y values for test data, using the > Kernel PLS method. Let's take the example in the R help: > > > data(NIR) > > attach(NIR) > > NIR.kernelpls <- mvr(Xtrain, Ytrain, 1:6, validation = "CV", > method="kernelPLS") > > > > How can we get the predicted Y values ("Ypred") for Xtest in > this case? > As far as I checked, there is no parameter to specify the test data in > "mvr" or "pls"....
2007 Jan 22
0
Recursive-SVM (R-SVM)
...!(SampInd %in% TrainInd ))] } else { ## Nfold TrainInd <- sample(SampInd, nSample*(CVtype-1)/CVtype ) TestInd <- SampInd[ which(!(SampInd %in% TrainInd ))] } } nTests <- nTests + length(TestInd) ## in each level, train a SVM model and record test error xTrain <- x[TrainInd, ] yTrain <- y[TrainInd] xTest <- x[TestInd,] yTest <- y[TestInd] ## index of the genes used in the SelInd <- seq(1, nGene) for( gLevel in 1:length(ladder) ) { ## record the genes selected in this ladder SelFreq[SelInd, gLevel] <- SelFreq[SelInd, gLevel] +1 ## train SVM model and tes...
2008 Feb 05
0
Uninformative error msgs w/ svm.default - Error in svm.default ... y must be a vector or a factor -
...: -1 1 > mode(m.cl.f) [1] "numeric" the rSVM function is called as such (it is a wrapper for svm in e1071, which then calls low-level svm.default ) - > rsvm_output <- RSVM(x=svm_num_mat, y=m.cl.f, ladder=laddy, CVtype="LOO" ) Error in svm.default(xTrain[, SelInd], yTrain, scale = F, type = "C-classification", : y must be a vector or a factor. ....the 'laddy' variable just specifies a recursive parameter for the overlying rSVM procedure - here, it calls the 1st round w/ all 12340 elements, then with the highest scoring 9255 elements, etc.....
2012 Aug 27
0
kernlab`s custom kernel of ksvm freeze
...inverse of standard deviation vector about each variables. (ex: v=(0.1666667,........0.1666667)`, length(v)= 57) training set defined 60% of spam data. (preserving the proportions of the different classes.) if data's type is spam, than data`s type = 1 for train svm (else -1) m=ksvm(xtrain,ytrain,type="C-svc",kernel=kp,C=10) But, this step is not working. always Waiting for a response. So, I ask you this problem, why? number of examples are too big? Is there any other R package that can train SVMs for user defined kernel? I want to your answer. Thanks in advance! -- V...
2012 Sep 13
0
I need help for svm package kernlab in R
I use the svm package kernlab .I have two question. In R library(kernlab) m=ksvm(xtrain,ytrain,type="C-svc",kernel=custom function, C=10) alpha(m) alphaindex(m) I can get alpha value and alpha index about package. 1. Assumption that number of sample are 20. number of support vectors are 15. then rest 5`s alphas are 0? 2. I want use kernelMatrix xtrain=as.matrix(xtrain)...
2018 Feb 19
0
questions regarding the svmpath package (functions svmpath and predict)
Hello, I have two questions. The svmpath package provides a svmpath function: --- fit <- svmpath(xtrain, ytrain, kernel.function = radial.kernel, param.kernel = 0.8) --- 1) How to get the optimal lambda value out of this result? The svmpath package also provides a predict function: --- ytest <- predict(fit, xtest) --- How to get a score (or a probability of belonging to one of the two classes) instead o...
2012 Feb 01
1
randomForest: proximity for new objects using an existing rf
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120201/cc22025d/attachment.pl>