In TestNaiveBayesDriver around line 115 is where it reads the output
of the Naive Bayes job and makes a confusion matrix. It is probably
better to make cmdump read that file instead of expecting all of the
classifier programs to make a separate kind of file.

On Mon, Jul 30, 2012 at 3:34 PM, Sam Hodgson <[email protected]> wrote:
>
> Thanks Lance, i'll try rolling back a few versions to see if i can get an 
> output.
>
> The output directory from the classifier holds the following:
>
> -rwxrwxrwx  1 root root  84K Jul 26 20:11 part-m-00000
> -rw-r--r--  1 root root  676 Jul 26 20:11 .part-m-00000.crc
> -rwxrwxrwx  1 root root    0 Jul 26 20:11 _SUCCESS
> -rw-r--r--  1 root root    8 Jul 26 20:11 ._SUCCESS.crc
>
> Cheers
>
> Sam
>
>> Date: Mon, 30 Jul 2012 14:28:37 -0700
>> Subject: Re: FW: cmdump
>> From: [email protected]
>> To: [email protected]
>>
>> I don't know what the output directory holds.
>>
>> There used to be code in TestNaiveBayesClassifier that saved the
>> confusion matrix to a separate file. This code has evaporated.
>>
>> On Sun, Jul 29, 2012 at 3:17 PM, Sam Hodgson <[email protected]> wrote:
>> >
>> > Hi,
>> >
>> > Sorry to repost this but im completely stuck and I cant find anything on 
>> > this anywhere.
>> >
>> > I've tried running this on the known good 20-newsgroup example output data 
>> > and also on version 0.7 and get the same error.
>> >
>> > Any suggestions at all would be appreciated.
>> >
>> > Thanks
>> >
>> > Sam
>> >
>> > From: [email protected]
>> > To: [email protected]
>> > Subject: cmdump
>> > Date: Thu, 26 Jul 2012 23:20:39 +0000
>> >
>> >
>> >
>> >
>> >
>> > Hi,
>> >
>> > Im having some trouble getting a text output from the confusion matrix 
>> > created by testnb.  Im running cmdump over part-m-00000 that was output by 
>> > test but getting the following error:
>> >
>> > bin/mahout cmdump -i spamfilter/test/part-m-00000 -o spamfilter/matrix/ 
>> > -ow --text
>> > Running on hadoop, using /usr/bin/hadoop and HADOOP_CONF_DIR=
>> > MAHOUT-JOB: 
>> > /root/svn/trunk/examples/target/mahout-examples-0.8-SNAPSHOT-job.jar
>> > 12/07/27 00:10:10 WARN driver.MahoutDriver: No cmdump.props found on 
>> > classpath, will use command-line arguments only
>> > 12/07/27 00:10:10 INFO common.AbstractJob: Command line arguments: 
>> > {--endPhase=[2147483647], --input=[spamfilter/test/part-m-00000], 
>> > --output=[spamfilter/matrix/], --overwrite=null, --startPhase=[0], 
>> > --tempDir=[temp], --text=null}
>> > Exception in thread "main" java.io.IOException: wrong value class: 
>> > org.apache.mahout.math.MatrixWritable@6833f0de is not class 
>> > org.apache.mahout.math.VectorWritable
>> >     at 
>> > org.apache.hadoop.io.SequenceFile$Reader.next(SequenceFile.java:1945)
>> >     at 
>> > org.apache.mahout.classifier.ConfusionMatrixDumper.readSeqFile(ConfusionMatrixDumper.java:230)
>> >     at 
>> > org.apache.mahout.classifier.ConfusionMatrixDumper.exportText(ConfusionMatrixDumper.java:169)
>> >     at 
>> > org.apache.mahout.classifier.ConfusionMatrixDumper.run(ConfusionMatrixDumper.java:155)
>> >     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
>> >     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
>> >     at 
>> > org.apache.mahout.classifier.ConfusionMatrixDumper.main(ConfusionMatrixDumper.java:134)
>> >     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:195)
>> >     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:197)
>> >
>> >
>> > Any help would be greatly appreciated!
>> >
>> > Cheers
>> >
>> > Sam
>> >
>>
>>
>>
>> --
>> Lance Norskog
>> [email protected]
>



-- 
Lance Norskog
[email protected]

Reply via email to