search for: xtrain

Displaying 14 results from an estimated 14 matches for "xtrain".

Did you mean: strain
2010 Mar 30
1
predict.kohonen for SOM returns NA?
...252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] kohonen_2.0.5 class_7.3-1 loaded via a namespace (and not attached): [1] tools_2.10.1 > data(wines) > set.seed(7) > training <- sample(nrow(wines), 120) > Xtraining <- scale(wines[training, ]) > Xtest <- scale(wines[-training, ], + center = attr(Xtraining, "scaled:center"), + scale = attr(Xtraining, "scaled:scale")) > som.wines <- som(Xtraining, grid = somgrid(5, 5, "hexagonal")) > som.prediction <- predict...
2007 Oct 23
1
Compute R2 and Q2 in PLS with pls.pcr package
...are given 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 r...
2010 Aug 16
0
Help for using nnet in R for NN training and testing
...tput variable and has 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. *************************************************************************...
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(...
2004 Nov 15
0
how to obtain predicted labels for test data using "kernelpls"
...g this email 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 &...
2009 Oct 14
0
Confusion matrix from cross validation in R:
Hey! 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...
2004 Nov 15
0
how to obtain predicted labels for test data using "kerne lpls"
...hing 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...
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>
2011 May 24
1
seeking help on using LARS package
...t;An accurate and interpretable model for siRNA efficacy prediction, 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...
2007 Jan 22
0
Recursive-SVM (R-SVM)
...estInd <- SampInd[ which(!(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...
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]]
2008 Feb 05
0
Uninformative error msgs w/ svm.default - Error in svm.default ... y must be a vector or a factor -
...-1 -1 -1 -1 Levels: -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 925...
2012 Aug 27
0
kernlab`s custom kernel of ksvm freeze
...hat are 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!...
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) i...