You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Sam Cunningham <sa...@yahoo.com> on 2011/12/02 22:46:37 UTC

testclassifier is not working

All,

I have 2 sets of news data; one to train another to test. I follow
instructions for 20news example on the Mahout In Action book. Because my
work is very similar. I am able to prepare the training and test sets using
prepare20newsgroups command. I am also able to generate the model. However,
when I test the classifier using testclassifier command, I get the following
error: 

Attached, I am including the test set along with the model. I searched
through past postings and came across someone saying that the tab characters
were supposed to be replaced with space characters in order to get the test
files tokenized correctly. I tried that too. It didn't work either. (By the
way I am using -c UTF-8). Any idea why it is not working?

Here is the full response :

sayhan@A4915037:~$ $MAHOUT_HOME/bin/mahout testclassifier -d
/home/sayhan/articles/articles-test -m /home/sayhan/articles/articles-model
-type cbayes -ng 1 -source hdfs -method sequential
Running on hadoop, using HADOOP_HOME=/usr/local/hadoop-0.20.2
HADOOP_CONF_DIR=/usr/local/hadoop-0.20.2/conf
11/12/02 16:13:23 WARN driver.MahoutDriver: No testclassifier.props found on
classpath, will use command-line arguments only
11/12/02 16:13:23 INFO bayes.TestClassifier: Loading model from:
{basePath=/home/sayhan/articles/articles-model, classifierType=cbayes,
alpha_i=1.0, dataSource=hdfs, gramSize=1, verbose=false, encoding=UTF-8,
defaultCat=unknown, testDirPath=/home/sayhan/articles/articles-test}
11/12/02 16:13:23 INFO bayes.TestClassifier: Testing Complementary Bayes
Classifier
Exception in thread "main" java.lang.IllegalArgumentException: Label not
found:
Entertainment
	at
com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
	at
org.apache.mahout.classifier.ConfusionMatrix.getCount(ConfusionMatrix.java:93)
	at
org.apache.mahout.classifier.ConfusionMatrix.incrementCount(ConfusionMatrix.java:113)
	at
org.apache.mahout.classifier.ConfusionMatrix.incrementCount(ConfusionMatrix.java:117)
	at
org.apache.mahout.classifier.ConfusionMatrix.addInstance(ConfusionMatrix.java:85)
	at
org.apache.mahout.classifier.ResultAnalyzer.addInstance(ResultAnalyzer.java:67)
	at
org.apache.mahout.classifier.bayes.TestClassifier.classifySequential(TestClassifier.java:252)
	at
org.apache.mahout.classifier.bayes.TestClassifier.main(TestClassifier.java:185)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
	at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
	at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:187)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

http://lucene.472066.n3.nabble.com/file/n3555768/articles-model.tar.gz
articles-model.tar.gz 
http://lucene.472066.n3.nabble.com/file/n3555768/articles-test.tar.gz
articles-test.tar.gz 

--
View this message in context: http://lucene.472066.n3.nabble.com/testclassifier-is-not-working-tp3555768p3555768.html
Sent from the Mahout User List mailing list archive at Nabble.com.