有一个分类问题,我在 R 中使用 SVM 进行预测。在数据集中,有整数和分类变量。使用 predict 方法进行预测时出现错误。
svp3c <- ksvm(input_dataset3$isCRgt3~., data=input_dataset3,type="C-svc")
p3<-predict(svp3c,newdata=input_dataset_prediction[,-1],type="response")
error :: Error in which.max(votematrix[, x]) : subscript out of bounds
对于这个建模
第一:使用训练数据集开发模型
第二:保存和加载模型以在测试数据集上进行预测
Training Dataset sample
Headning :
head1(int),head2(character-url),head3(character-url),head4(character-url),head5(character),head6(character),haed7(int),head8(int),head9(int),head10(int),head11(int)
Data:
"0","10","/","/index.php?main_page=logoff","(not set)","rc317a","organic","0","4","20092","5023","0"
"1","11","/","/offwhite-churidar-kameez-set-p-17381.html","(not set)","rc317a","organic","0","4","20092","5023","0"
[下载样本数据集] http://www.2shared.com/file/tQRapbBt/input_dataset3.html
【重现R脚本】http://www.2shared.com/file/NpDs5V-9/data1_train.html
任何人都可以提出建议吗?