You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Divya <di...@k2associates.com.sg> on 2010/12/08 10:33:30 UTC
RE: multilabel classification-Cbayes
Hi,
Train input files 2 wikipedia chunks of 1 MB each.
Test input file is one Wikipedia chunk of 1 MB.
I have passed -type cbayes argument for trainclassifier it gave me the result and I could see the generated model.
File name Size
-------------------------------------------- ------------------------------------
wiki-sub_model_cbayes\trainer-tfIdf\trainer-tfIdf\part-00000 110KB
wiki-sub_model_cbayes\trainer-thetaNormalizer\part-00000 1KB
wiki-sub_model_cbayes\trainer-weights\Sigma_j\part-00000 81KB
wiki-sub_model_cbayes\trainer-weights\Sigma_k\part-00000 1KB
wiki-sub_model_cbayes\trainer-weights\Sigma_kSigma_j\part-00000 1KB
But when I cbayes argument for testclassifier I have got null pointer exception .
$ bin/mahout testclassifier -m examples/bin/work/wikipedia/wikipediaClassification/wiki_sub_model_cbayes -d examples/bin/work/wikipedi
a/wikipediaClassification/train-subject -type cbayes
Running on hadoop, using HADOOP_HOME=C:\cygwin\home\Divya\hadoop-0.20.2
HADOOP_CONF_DIR=C:\cygwin\home\Divya\hadoop-0.20.2\conf
10/12/08 16:39:22 INFO bayes.TestClassifier: Loading model from: {basePath=examples/bin/work/wikipedia/wikipediaClassification/wiki_sub
_model_cbayes, classifierType=bayes, alpha_i=1.0, dataSource=hdfs, gramSize=1, verbose=false, encoding=UTF-8, defaultCat=unknown, testD
irPath=examples/bin/work/wikipedia/wikipediaClassification/train-subject}
10/12/08 16:39:22 INFO bayes.TestClassifier: Testing Bayes Classifier
Exception in thread "main" java.lang.NullPointerException
at org.apache.mahout.classifier.ConfusionMatrix.getCount(ConfusionMatrix.java:102)
at org.apache.mahout.classifier.ConfusionMatrix.incrementCount(ConfusionMatrix.java:118)
at org.apache.mahout.classifier.ConfusionMatrix.incrementCount(ConfusionMatrix.java:122)
at org.apache.mahout.classifier.ConfusionMatrix.addInstance(ConfusionMatrix.java:90)
at org.apache.mahout.classifier.ResultAnalyzer.addInstance(ResultAnalyzer.java:68)
at org.apache.mahout.classifier.bayes.TestClassifier.classifySequential(TestClassifier.java:266)
at org.apache.mahout.classifier.bayes.TestClassifier.main(TestClassifier.java:186)
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:184)
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)
Regards,
Divya
-----Original Message-----
From: Robin Anil [mailto:robin.anil@gmail.com]
Sent: Wednesday, December 08, 2010 3:08 PM
To: user@mahout.apache.org
Subject: Re: multilabel classification
Complementary Bayes classifier is perfect for multi-label classification
On Wed, Dec 8, 2010 at 12:15 PM, David Hagar <da...@occamlaw.com> wrote:
> Hi all,
>
> I'm looking at a multilabel classification problem -- I saw there was
> some talk on the mailing list last year of adapting the mahout LDA
> code to L-LDA for multilabel classification.
>
> Does anyone know if progress has been made on this front? Or are there
> other algorithms within mahout useful for this task?
>
> Thanks,
> David
>