Re: [R] Question in using e1071 svm routine
R, by default, has some of the most cryptic error / debug messages ever invented. The error message encountered by the two posters: Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion results from the inclusion of a factor variable in the x data frame passed to the svm(x,y) call. I've mistakenly done this many times; the text of the error message gives no indication that this is the source of the problem. Removing the factor(s) from x will eliminate the error. Nathan Kupp Ph.D. Candidate Department of Electrical Engineering Yale University -- View this message in context: http://r.789695.n4.nabble.com/Question-in-using-e1071-svm-routine-tp896541p3034950.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Question in using e1071 svm routine
On Nov 9, 2010, at 2:18 PM, nathan.kupp wrote: R, by default, has some of the most cryptic error / debug messages ever invented. The error message encountered by the two posters: Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion results from the inclusion of a factor variable in the x data frame passed to the svm(x,y) call. ?svm No documentation for 'svm' in specified packages and libraries: you could try '??svm' So svm is not part of R core. The inference is that the authors of svm built a package that did not provide informative error messages ... NOT that R is responsible. I've mistakenly done this many times; the text of the error message gives no indication that this is the source of the problem. Removing the factor(s) from x will eliminate the error. Instead of sending this message to a group of people who have no control over the process ... Why don't you take a more constructive path and suggest to the authors of svm that they test for invalid data being passed to the portion of the code that is throwing this error? Perhaps you could offer code since it appears you have examined the problem in more than -- avid. Nathan Kupp Ph.D. Candidate Department of Electrical Engineering Yale University -- __ R-help@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.
Re: [R] Question in using e1071 svm routine
On Tue, Nov 9, 2010 at 11:18 AM, nathan.kupp nathan.k...@yale.edu wrote: R, by default, has some of the most cryptic error / debug messages ever invented. I nominate the html 404 error for that. The error message encountered by the two posters: Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion results from the inclusion of a factor variable in the x data frame passed to the svm(x,y) call. I've mistakenly done this many times; the text of the error message gives no indication that this is the source of the problem. Passing data to a function without knowing its str()ucture is like going into surgery without knowing which leg should be amputated---it's polite if your surgeon knows, but I'd never rely on it. Removing the factor(s) from x will eliminate the error. Nathan Kupp Ph.D. Candidate Department of Electrical Engineering Yale University -- View this message in context: http://r.789695.n4.nabble.com/Question-in-using-e1071-svm-routine-tp896541p3034950.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. -- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/ __ R-help@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.
Re: [R] Question in using e1071 svm routine
Hi all, I am encountering the same error Error in if (any(co)) { : missing value where TRUE/FALSE needed when i run:model - svm(databctrain, classesbctrain) I am not sure what this error means . is it some problem with the dataset ? Could i get some help ? Thanks, Akshatha losemind wrote: Hi all, I've got the following error message in using e1071 svm routine... Could anybody please help me? Thank you! - model - svm(y=factor(mytraindata[, 1]), x=mytraindata[, -1], probability=T) Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion __ R-help@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. -- View this message in context: http://old.nabble.com/Question-in-using-e1071-svm-routine-tp24382208p26522910.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Question in using e1071 svm routine
On Nov 25, 2009, at 7:54 PM, akal wrote: Hi all, I am encountering the same error Error in if (any(co)) { : missing value where TRUE/FALSE needed when i run:model - svm(databctrain, classesbctrain) I am not sure what this error means . is it some problem with the dataset ? How do you propose that we address this question? Could i get some help ? Only if you supply sufficient information. Read the Posting Guide before reposting, please. -- David Thanks, Akshatha losemind wrote: Hi all, I've got the following error message in using e1071 svm routine... Could anybody please help me? Thank you! - model - svm(y=factor(mytraindata[, 1]), x=mytraindata[, -1], probability=T) Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion __ R-help@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. -- View this message in context: http://old.nabble.com/Question-in-using-e1071-svm-routine-tp24382208p26522910.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@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.
[R] Question in using e1071 svm routine
Hi all, I've got the following error message in using e1071 svm routine... Could anybody please help me? Thank you! - model - svm(y=factor(mytraindata[, 1]), x=mytraindata[, -1], probability=T) Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion __ R-help@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.
Re: [R] Question in using e1071 svm routine
Unlike Splus, R does not use T for TRUE. On Tue, Jul 7, 2009 at 6:05 PM, Michaelcomtech@gmail.com wrote: Hi all, I've got the following error message in using e1071 svm routine... Could anybody please help me? Thank you! - model - svm(y=factor(mytraindata[, 1]), x=mytraindata[, -1], probability=T) Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion __ R-help@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. -- Max __ R-help@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.
Re: [R] Question in using e1071 svm routine
Isn't the initial value of the variable T equal to the constant TRUE? So unless he's modified the value of T, shouldn't it work? -s On 7/7/09, Max Kuhn mxk...@gmail.com wrote: Unlike Splus, R does not use T for TRUE. On Tue, Jul 7, 2009 at 6:05 PM, Michaelcomtech@gmail.com wrote: Hi all, I've got the following error message in using e1071 svm routine... Could anybody please help me? Thank you! - model - svm(y=factor(mytraindata[, 1]), x=mytraindata[, -1], probability=T) Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion __ R-help@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. -- Max __ R-help@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. __ R-help@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.
Re: [R] Question in using e1071 svm routine
Hi, On Jul 7, 2009, at 8:37 PM, Stavros Macrakis wrote: Isn't the initial value of the variable T equal to the constant TRUE? So unless he's modified the value of T, shouldn't it work? Yes, it should. Perhaps we should be looking at your data: model - svm(y=factor(mytraindata[, 1]), x=mytraindata[, -1], probability=T) Error in if (any(co)) { : missing value where TRUE/FALSE needed In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion 1) Where is the NAs introduced by coercion warning coming from? When you're trying to convert your y into a factor? Are there NA's in your predictors or labels? 2) It looks like the codepath that leads to your error: `if any(co)) ...` only is meant to execute when `length(scale)` != 1 ... why is it going there? (See the source of svm.default to see what I mean) Otherwise, your code should work just fine, see: R library(e1071) Loading required package: class R data(iris) R model - svm(y=iris[,5], x=iris[,-5], probability=T) R model Call: svm.default(x = iris[, -5], y = iris[, 5], probability = T) Parameters: SVM-Type: C-classification SVM-Kernel: radial cost: 1 gamma: 0.25 Number of Support Vectors: 51 -steve -- Steve Lianoglou Graduate Student: Physiology, Biophysics and Systems Biology Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos __ R-help@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.