mahout中的illegalargumentexception

5jvtdoz2  于 2021-06-04  发布在  Hadoop
关注(0)|答案(1)|浏览(402)

我运行了以下命令:

//Training the classifier
$ mahout trainnb -i train-vectors -el -li labelindex -o model -ow -c

//Testing the classifer on the TRAINING set
$ mahout testnb -i train-vectors -m model -l labelindex -ow -o tweets-testing -c

//Testing the classifier with the TESTING SET
$ mahout testnb -i test-vectors -m model -l labelindex -ow -o tweets-testing -c

在运行最后一个命令时,这是我得到的错误

Exception in thread "main" java.lang.IllegalArgumentException: Label not found:
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
    at org.apache.mahout.classifier.ConfusionMatrix.getCount(ConfusionMatrix.java:102)
    at org.apache.mahout.classifier.ConfusionMatrix.incrementCount(ConfusionMatrix.java:122)
    at org.apache.mahout.classifier.ConfusionMatrix.incrementCount(ConfusionMatrix.java:126)
    at org.apache.mahout.classifier.ConfusionMatrix.addInstance(ConfusionMatrix.java:94)

我在这里举个例子。
我用seqdumper检查了labelindex文件,所有的类/标记都存在。该文件也是hdfs格式。
我做错什么了?

s4n0splo

s4n0splo1#

好的,如果你的labelindex文件是正确的。因为,错误没有指定缺少的标签。检查你的tweet数据是否有标签。我猜,一个或多个推文没有标记。

相关问题