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.