[R] SVM Prediction and Plot

Brian cttobin at hotmail.com
Wed Feb 2 19:40:18 CET 2011


There are a good few blanks in some variables in the data. There were in the
training set too. Is that a problem? I don't have any na.action in my svm
call either. 

So na.omit=na.fail causes this error:
Error in na.fail.default(newdata) : missing values in object

I tried the matrix. 
>SvmPred = predict(Svm, as.matrix(BankTest[,-1]))
Error in scale.default(newdata[, object$scaled, drop = FALSE], center =
object$x.scale$"scaled:center",  : 
  length of 'center' must equal the number of columns of 'x'

Also is.matrix fails for BankTest so it isn't actually a matrix. Not sure it
matters though. The prediction is actually working somewhat, but it only
predicts for 2282 cases instead of 2598.



P.s. I do have the probability set to TRUE in the Svm call already.
-- 
View this message in context: http://r.789695.n4.nabble.com/SVM-Prediction-and-Plot-tp3254421p3255323.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list