Reputation: 1439
I ran the following commands:
//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
On running the last command, this is the error I get
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)
I am following the example here.
I checked labelindex file with seqdumper and all the classes/tags are present. The file is also in HDFS format.
What am I doing wrong here?
Upvotes: 2
Views: 682
Reputation: 375
Ok, if your labelindex file is correct. Since, the error did not specify what label was missing. Check if your tweet data are tagged. My guess, one or more tweets are not tagged.
Upvotes: 1