An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120819/7103b53e/attachment.pl>
kernlab | ksvm error
7 messages · Uwe Ligges, Reza Salimi-Khorshidi
On 19.08.2012 11:06, Reza Salimi-Khorshidi wrote:
Dear list, I am using the ksvm function from kernlab as follows: (1) learning
svm.pol4 <- ksvm(class.labs ~ ., data = train.data, prob.model = T, scale
= T, kernel = "polydot") (2) prediction
svm.pol.prd4 <- predict(svm.pol4, train.data, type = "probabilities")[,2]
But unfortunately, when calling the prediction, once in every 10s of times (using the exact same data), it returns the following error message: Error in prob.model(object)[[p]]$A : $ operator is invalid for atomic vectors Calls: predict -> predict -> .local -> .SigmoidPredict Execution halted Does anyone know what the problem is? Any help will be much appreciated.
We need a reproducible example. Best, Uwe Ligges
Cheers [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120819/56c0a16d/attachment.pl>
5 days later
Dear Uwe, I appreciate that if you let me know why, when using the attached file, the following script (two lines) doesn't work once in 10s of times. Best, Reza svm.pol4 <- ksvm(class.labs ~ ., data = train.data, prob.model = T, scale = T, kernel = "polydot") svm.pol.prd4 <- predict(svm.pol4, train.data, type = "probabilities")[,2]
1 day later
On 25.08.2012 02:12, Reza Salimi-Khorshidi wrote:
Dear Uwe, I appreciate that if you let me know why, when using the attached file, the following script (two lines) doesn't work once in 10s of times. Best, Reza svm.pol4<- ksvm(class.labs~ ., data= train.data, prob.model= T, scale= T, kernel= "polydot") svm.pol.prd4<- predict(svm.pol4, train.data, type= "probabilities")[,2]
Some randomness is involved, and when you get an unfortunate subsample (e.g. if in the internal cross-validation one class is not selected at all) it won't work anymore. Best, Uwe Ligges
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120826/2ce7db62/attachment.pl>
On 26.08.2012 15:33, Reza Salimi-Khorshidi wrote:
Thanks Uwe, Am I right that in ksvm's internal cross-validation, there is no guarantee for having *at least one* of each classes in each subset?
That is my guess, but I haven't read the code. Please read it yourself in case you want more details - or ask the author of tht function. Best, Uwe Ligges
Some randomness is involved, and when you get an unfortunate
subsample (e.g. if in the internal cross-validation one class is not
selected at all) it won't work anymore.