【问题标题】:Train and Test Set are not compatible: comparing 2 csv files训练集和测试集不兼容:比较 2 个 csv 文件
【发布时间】:2014-07-06 09:05:35
【问题描述】:

我现在面临一个 Weka 的通病,“Train and Test Set is not compatible”。 我有一个 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

谁能给我建议。

谢谢,

【问题讨论】:

    标签: weka


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2015-01-17
      • 2019-08-15
      • 2013-11-16
      • 2012-12-04
      • 2013-01-01
      • 2018-10-19
      • 2013-03-23
      • 2016-03-20
      • 2013-07-14
      相关资源
      最近更新 更多