I m using SVM for classification, I have devided my data set into two CSV file one is training set (70 % of data) and other is testing set (30 % of data). when i use predict on the trainig set i m getting answer but on testing set it shows error I m using e1071 package
program as follow
Train <- read.csv("Train.csv")
Test <- read.csv("Test.csv")
x_Train <- subset(Train,select=-Class)
y_Train <- Train$Class
model <- svm(Class ~., data=Train)
pred=predict(model, x_Train) #working well
table(pred,y_Train)
x_Test <- subset(Test,select=-Class)
y_Test <- Test$Class
pred <- predict(model, x_Test) #getting_error
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'
Will you please figure out wat could be the problem...?