【问题标题】:Weka exception: Train and test file not compatibleWeka 异常:训练和测试文件不兼容
【发布时间】:2012-03-31 11:08:14
【问题描述】:

我是 WEKA 的新手,我正在尝试执行基本的培训/测试任务。但是,当我发出命令时:

java -cp ~/Applications/weka36/weka.jar weka.classifiers.functions.SMO -t pos_neg.arff -T w1/apple_iphone.arff > ../outputs/pos_neg_apple_iphone.txt

我收到一个错误:Weka exception: Train and test file not compatible

我猜是因为标题。两个arff文件的最后一个属性不一样。但是,pos_neg.arff 包含我的基本事实,所以最后一个属性是:

@attribute twit {negative, postive}

那么 pos_neg_apple_iphone.arff 中的最后一个属性应该是什么?我想它不应该是正面或负面的,因为这是要确定的,即它是测试文件。

实际上,如果确实将测试文件中的最后一个属性指定为与训练文件相同。 WEKA 所做的是将测试文件中的属性视为基本事实,并输出准确性,而不是将推文分类为正面或负面。

【问题讨论】:

    标签: weka


    【解决方案1】:

    我可能会找到答案。应该使用 -p [列数] 来进行预测。

    参考:http://maya.cs.depaul.edu/classes/ect584/weka/classify.html

    【讨论】:

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