训练和测试集不兼容:比较2个csv文件

时间:2014-05-18 08:58:05

标签: weka

我现在面临Weka的常见问题,"火车和测试装置不兼容"。 我有一个csv格式的大型数据集。当我收到这样的错误时,我将数据集(用于实践目的)减少到列车集中的2个数据和测试集中的1个数据。我正在使用j48分类器。

我检查过csv中出现相同的数据格式,同样的列标题也出现了。

列车和测试装置如下:

训练集:

Stop Words/Punctuations1(L),Stop Words/Punctuations/Stemming1(L),Stop Words/Punctuations/Lammetizing1(L),Stop Words/Punctuations1(NC),Stop Words/Punctuations/Stemming1(NC),Stop Words/Punctuations/Lammetizing1(NC),Stop Words/Punctuations2(L),Stop Words/Punctuations/Stemming2(L),Stop Words/Punctuations/Lammetizing2(L),Stop Words/Punctuations2(NC),Stop Words/Punctuations/Stemming2(NC),Stop Words/Punctuations/Lammetizing2(NC),Stop Words/Punctuations3(L),Stop Words/Punctuations/Stemming3(L),Stop Words/Punctuations/Lammetizing3(L),Stop Words/Punctuations3(NC),Stop Words/Punctuations/Stemming3(NC),Stop Words/Punctuations/Lammetizing3(NC),Stop Words/Punctuations4(L),Stop Words/Punctuations/Stemming4(L),Stop Words/Punctuations/Lammetizing4(L),Stop Words/Punctuations4(NC),Stop Words/Punctuations/Stemming4(NC),Stop Words/Punctuations/Lammetizing4(NC),Stop Words/Punctuations5(L),Stop Words/Punctuations/Stemming5(L),Stop Words/Punctuations/Lammetizing5(L),Stop Words/Punctuations5(NC),Stop Words/Punctuations/Stemming5(NC),Stop Words/Punctuations/Lammetizing5(NC),(No Stop Words/Punctuations)1(L),(No Stop Words/Punctuations)/Stemming1(L),(No Stop Words/Punctuations)/Lammetizing1(L),(No Stop Words/Punctuations)1(NC),(No Stop Words/Punctuations)/Stemming1(NC),(No Stop Words/Punctuations)/Lammetizing1(NC),(No Stop Words/Punctuations)2(L),(No Stop Words/Punctuations)/Stemming2(L),(No Stop Words/Punctuations)/Lammetizing2(L),(No Stop Words/Punctuations)2(NC),(No Stop Words/Punctuations)/Stemming2(NC),(No Stop Words/Punctuations)/Lammetizing2(NC),(No Stop Words/Punctuations)3(L),(No Stop Words/Punctuations)/Stemming3(L),(No Stop Words/Punctuations)/Lammetizing3(L),(No Stop Words/Punctuations)3(NC),(No Stop Words/Punctuations)/Stemming3(NC),(No Stop Words/Punctuations)/Lammetizing3(NC),(No Stop Words/Punctuations)4(L),(No Stop Words/Punctuations)/Stemming4(L),(No Stop Words/Punctuations)/Lammetizing4(L),(No Stop Words/Punctuations)4(NC),(No Stop Words/Punctuations)/Stemming4(NC),(No Stop Words/Punctuations)/Lammetizing4(NC),(No Stop Words/Punctuations)5(L),(No Stop Words/Punctuations)/Stemming5(L),(No Stop Words/Punctuations)/Lammetizing5(L),(No Stop Words/Punctuation)5(NC),(No Stop Words/Punctuations)/Stemming5(NC),(No Stop Words/Punctuations)/Lammetizing5(NC),No Stop Words1(L),No Stop Words/Stemming1(L),No Stop Words/Lammetizing1(L),No Stop Words1(NC),No Stop Words/Stemming1(NC),No Stop Words/Lammetizing1(NC),No Stop Words2(L),No Stop Words/Stemming2(L),No Stop Words/Lammetizing2(L),No Stop Words2(NC),No Stop Words/Stemming2(NC),No Stop Words/Lammetizing2(NC),No Stop Words3(L),No Stop Words/Stemming3(L),No Stop Words/Lammetizing3(L),No Stop Words3(NC),No Stop Words/Stemming3(NC),No Stop Words/Lammetizing3(NC),No Stop Words4(L),No Stop Words/Stemming4(L),No Stop Words/Lammetizing4(L),No Stop Words4(NC),No Stop Words/Stemming4(NC),No Stop Words/Lammetizing4(NC),No Stop Words5(L),No Stop Words/Stemming5(L),No Stop Words/Lammetizing5(L),No Stop Words5(NC),No Stop Words/Stemming5(NC),No Stop Words/Lammetizing5(NC),No Punctuations1(L),No Punctuations/Stemming1(L),No Punctuations/Lammetizing1(L),No Punctuations1(NC),No Punctuations/Stemming1(NC),No Punctuations/Lammetizing1(NC),No Punctuations2(L),No Punctuations/Stemming2(L),No Punctuations/Lammetizing2(L),No Punctuations2(NC),No Punctuations/Stemming2(NC),No Punctuations/Lammetizing2(NC),No Punctuations3(L),No Punctuations/Stemming3(L),No Punctuations/Lammetizing3(L),No Punctuations3(NC),No Punctuations/Stemming3(NC),No Punctuations/Lammetizing3(NC),No Punctuations4(L),No Punctuations/Stemming4(L),No Punctuations/Lammetizing4(L),No Punctuations4(NC),No Punctuations/Stemming4(NC),No Punctuations/Lammetizing4(NC),No Punctuations5(L),No Punctuations/Stemming5(L),No Punctuations/Lammetizing5(L),No Punctuations5(NC),No Punctuations/Stemming5(NC),No Punctuations/Lammetizing5(NC),Class
1.00,2.00,3.00,2.00,4.00,4.20,4.80,5.40,6.00,6.60,7.20,7.80,8.40,9.00,9.60,10.20,10.80,11.40,12.00,12.60,13.20,13.80,14.40,15.00,15.60,16.20,16.80,17.40,18.00,18.60,19.20,19.80,20.40,21.00,21.60,22.20,22.80,23.40,24.00,24.60,25.20,25.80,26.40,27.00,27.60,28.20,28.80,29.40,30.00,30.60,31.20,31.80,32.40,33.00,33.60,34.20,34.80,35.40,36.00,36.60,37.20,37.80,38.40,39.00,39.60,40.20,40.80,41.40,42.00,42.60,43.20,43.80,44.40,45.00,45.60,46.20,46.80,47.40,48.00,48.60,49.20,49.80,50.40,51.00,51.60,52.20,52.80,53.40,54.00,54.60,55.20,55.80,56.40,57.00,57.60,58.20,58.80,59.40,60.00,60.60,61.20,61.80,62.40,63.00,63.60,64.20,64.80,65.40,66.00,66.60,67.20,67.80,68.40,69.00,69.60,70.20,70.80,71.40,72.00,72.60,HR
1.00,2.00,3.00,2.00,4.00,4.20,4.80,5.40,6.00,6.60,7.20,7.80,8.40,9.00,9.60,10.20,10.80,11.40,12.00,12.60,13.20,13.80,14.40,15.00,15.60,16.20,16.80,17.40,18.00,18.60,19.20,19.80,20.40,21.00,21.60,22.20,22.80,23.40,24.00,24.60,25.20,25.80,26.40,27.00,27.60,28.20,28.80,29.40,30.00,30.60,31.20,31.80,32.40,33.00,33.60,34.20,34.80,35.40,36.00,36.60,37.20,37.80,38.40,39.00,39.60,40.20,40.80,41.40,42.00,42.60,43.20,43.80,44.40,45.00,45.60,46.20,46.80,47.40,48.00,48.60,49.20,49.80,50.40,51.00,51.60,52.20,52.80,53.40,54.00,54.60,55.20,55.80,56.40,57.00,57.60,58.20,58.80,59.40,60.00,60.60,61.20,61.80,62.40,63.00,63.60,64.20,64.80,65.40,66.00,66.60,67.20,67.80,68.40,69.00,69.60,70.20,70.80,71.40,72.00,72.60,LR

测试集:

Stop Words/Punctuations1(L),Stop Words/Punctuations/Stemming1(L),Stop Words/Punctuations/Lammetizing1(L),Stop Words/Punctuations1(NC),Stop Words/Punctuations/Stemming1(NC),Stop Words/Punctuations/Lammetizing1(NC),Stop Words/Punctuations2(L),Stop Words/Punctuations/Stemming2(L),Stop Words/Punctuations/Lammetizing2(L),Stop Words/Punctuations2(NC),Stop Words/Punctuations/Stemming2(NC),Stop Words/Punctuations/Lammetizing2(NC),Stop Words/Punctuations3(L),Stop Words/Punctuations/Stemming3(L),Stop Words/Punctuations/Lammetizing3(L),Stop Words/Punctuations3(NC),Stop Words/Punctuations/Stemming3(NC),Stop Words/Punctuations/Lammetizing3(NC),Stop Words/Punctuations4(L),Stop Words/Punctuations/Stemming4(L),Stop Words/Punctuations/Lammetizing4(L),Stop Words/Punctuations4(NC),Stop Words/Punctuations/Stemming4(NC),Stop Words/Punctuations/Lammetizing4(NC),Stop Words/Punctuations5(L),Stop Words/Punctuations/Stemming5(L),Stop Words/Punctuations/Lammetizing5(L),Stop Words/Punctuations5(NC),Stop Words/Punctuations/Stemming5(NC),Stop Words/Punctuations/Lammetizing5(NC),(No Stop Words/Punctuations)1(L),(No Stop Words/Punctuations)/Stemming1(L),(No Stop Words/Punctuations)/Lammetizing1(L),(No Stop Words/Punctuations)1(NC),(No Stop Words/Punctuations)/Stemming1(NC),(No Stop Words/Punctuations)/Lammetizing1(NC),(No Stop Words/Punctuations)2(L),(No Stop Words/Punctuations)/Stemming2(L),(No Stop Words/Punctuations)/Lammetizing2(L),(No Stop Words/Punctuations)2(NC),(No Stop Words/Punctuations)/Stemming2(NC),(No Stop Words/Punctuations)/Lammetizing2(NC),(No Stop Words/Punctuations)3(L),(No Stop Words/Punctuations)/Stemming3(L),(No Stop Words/Punctuations)/Lammetizing3(L),(No Stop Words/Punctuations)3(NC),(No Stop Words/Punctuations)/Stemming3(NC),(No Stop Words/Punctuations)/Lammetizing3(NC),(No Stop Words/Punctuations)4(L),(No Stop Words/Punctuations)/Stemming4(L),(No Stop Words/Punctuations)/Lammetizing4(L),(No Stop Words/Punctuations)4(NC),(No Stop Words/Punctuations)/Stemming4(NC),(No Stop Words/Punctuations)/Lammetizing4(NC),(No Stop Words/Punctuations)5(L),(No Stop Words/Punctuations)/Stemming5(L),(No Stop Words/Punctuations)/Lammetizing5(L),(No Stop Words/Punctuation)5(NC),(No Stop Words/Punctuations)/Stemming5(NC),(No Stop Words/Punctuations)/Lammetizing5(NC),No Stop Words1(L),No Stop Words/Stemming1(L),No Stop Words/Lammetizing1(L),No Stop Words1(NC),No Stop Words/Stemming1(NC),No Stop Words/Lammetizing1(NC),No Stop Words2(L),No Stop Words/Stemming2(L),No Stop Words/Lammetizing2(L),No Stop Words2(NC),No Stop Words/Stemming2(NC),No Stop Words/Lammetizing2(NC),No Stop Words3(L),No Stop Words/Stemming3(L),No Stop Words/Lammetizing3(L),No Stop Words3(NC),No Stop Words/Stemming3(NC),No Stop Words/Lammetizing3(NC),No Stop Words4(L),No Stop Words/Stemming4(L),No Stop Words/Lammetizing4(L),No Stop Words4(NC),No Stop Words/Stemming4(NC),No Stop Words/Lammetizing4(NC),No Stop Words5(L),No Stop Words/Stemming5(L),No Stop Words/Lammetizing5(L),No Stop Words5(NC),No Stop Words/Stemming5(NC),No Stop Words/Lammetizing5(NC),No Punctuations1(L),No Punctuations/Stemming1(L),No Punctuations/Lammetizing1(L),No Punctuations1(NC),No Punctuations/Stemming1(NC),No Punctuations/Lammetizing1(NC),No Punctuations2(L),No Punctuations/Stemming2(L),No Punctuations/Lammetizing2(L),No Punctuations2(NC),No Punctuations/Stemming2(NC),No Punctuations/Lammetizing2(NC),No Punctuations3(L),No Punctuations/Stemming3(L),No Punctuations/Lammetizing3(L),No Punctuations3(NC),No Punctuations/Stemming3(NC),No Punctuations/Lammetizing3(NC),No Punctuations4(L),No Punctuations/Stemming4(L),No Punctuations/Lammetizing4(L),No Punctuations4(NC),No Punctuations/Stemming4(NC),No Punctuations/Lammetizing4(NC),No Punctuations5(L),No Punctuations/Stemming5(L),No Punctuations/Lammetizing5(L),No Punctuations5(NC),No Punctuations/Stemming5(NC),No Punctuations/Lammetizing5(NC),Class
25.41,25.41,24.86,0.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,HR

任何人都可以告诉我这件事。

谢谢,

1 个答案:

答案 0 :(得分:0)

好吧,我不确定你的整个数据集,但对于你发布的样本,我认为这是因为在你的测试集中只有一个类标签。我只是复制了测试集中的行并添加了第二个标签(LR),一切正常。我想你必须在训练和测试集中有相同的类标签来评估分类器。祝你好运。