I am having problem with plotting results of SVM
classification for the spam dataset from kernlab
package..
Code:
require(kernlab)
data(spam)
index <- sample(1:dim(spam)[1])
spamtrain <- spam[index[1:floor(dim(spam)[1]/2)], ]
spamtest <- spam[index[((ceiling(dim(spam)[1]/2)) + 1):dim(spam)[1]], ]
filter <- ksvm(type~.,data=spamtrain,kernel="rbfdot",kpar=list(sigma=0.05),C=5,cross=3)
plot(filter, data=spamtrain)
Error:
Error in `[.data.frame`(expand.grid(lis), , labels(terms(x))) :
undefined columns selected