Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

hadoop - How to resolve load main class MahoutDriver error on Twenty Newsgroups Classification Example

I am trying to run the 2newsgroup classification example in Mahout. I have set MAHOUT_LOCAL=true, the classifier doesn't display the Confusion matrix and gives the following warnings :

ok. You chose 2 and we'll use naivebayes
creating work directory at /tmp/mahout-work-cloudera
+ echo 'Preparing 20newsgroups data'
Preparing 20newsgroups data
+ rm -rf /tmp/mahout-work-cloudera/20news-all
+ mkdir /tmp/mahout-work-cloudera/20news-all
+ cp -R /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/alt.atheism /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/comp.graphics /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/comp.os.ms-windows.misc /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/comp.sys.ibm.pc.hardware /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/comp.sys.mac.hardware /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/comp.windows.x /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/misc.forsale /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/rec.autos /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/rec.motorcycles /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/rec.sport.baseball /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/rec.sport.hockey /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/sci.crypt /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/sci.electronics /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/sci.med /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/sci.space /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/soc.religion.christian /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/talk.politics.guns /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/talk.politics.mideast /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/talk.politics.misc /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-test/talk.religion.misc /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/alt.atheism /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/comp.graphics /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/comp.os.ms-windows.misc /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/comp.sys.ibm.pc.hardware /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/comp.sys.mac.hardware /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/comp.windows.x /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/misc.forsale /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/rec.autos /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/rec.motorcycles /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/rec.sport.baseball /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/rec.sport.hockey /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/sci.crypt /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/sci.electronics /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/sci.med /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/sci.space /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/soc.religion.christian /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/talk.politics.guns /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/talk.politics.mideast /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/talk.politics.misc /tmp/mahout-work-cloudera/20news-bydate/20news-bydate-train/talk.religion.misc /tmp/mahout-work-cloudera/20news-all
+ '[' '' '!=' '' ']'
+ echo 'Creating sequence files from 20newsgroups data'
Creating sequence files from 20newsgroups data
+ ./bin/mahout seqdirectory -i /tmp/mahout-work-cloudera/20news-all -o /tmp/mahout-work-cloudera/20news-seq -ow


MAHOUT_LOCAL is set, so we don't add HADOOP_CONF_DIR to classpath.
MAHOUT_LOCAL is set, running locally
Error: Could not find or load main class org.apache.mahout.driver.MahoutDriver

Please give me any solution Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This error was due to incorrect apache maven path and POM file i simply put pom.xml file (including mahout-master full source code ) under apache-maven-3.2.1 and run command again this method definitely solve this problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...