I am using the SVM method of machine learning. When I used the model to make prediction on test dataset, I got all NAs. I think the issue is from kernlab
. How could I deal with this? Any suggestions will be much appreciated. Thanks
library(e1071)
library(kernlab)
model_svm<-train(nzv[index,], trainSet.y, method='svmRadial', trControl=fitControl, tuneLength=6)
testSet$model_svm <- predict(model_svm, testSet)
testSet$model_svm <- predict(model_svm, testSet)
Warning message:
In method$predict(modelFit = modelFit, newdata = newdata, submodels = param) :
kernlab class prediction calculations failed; returning NAs
testSet$model_svm
[1] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
[25] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
Levels: N Y