简体   繁体   English

在Apache Mahout中从命令行运行自定义的朴素贝叶斯分类器

[英]Running customized naive bayes classifier from command line in apache mahout

I have written my Java to invoke naive bayes classifier with the desired parameters. 我已经编写了Java以使用所需参数来调用朴素贝叶斯分类器。

I use eclipse with m2e plugin. 我将eclipse与m2e插件一起使用。 My file is ZClassifier.java and resides at 我的文件是ZClassifier.java,位于

$MAHOUT_HOME/examples/src/main/java/org/apache/mahout/classifier/bayes.

I am able to run it from eclipse, but I am not able to do it via command line. 我可以从eclipse运行它,但是我不能通过命令行来运行它。 Kindly help me to run the same from the command line. 请帮助我从命令行运行相同的命令。

This is a java classpath question, rather a mahout question. 这是一个Java类路径问题,而不是mahout问题。 Anyway, I think you can try this: 无论如何,我认为您可以尝试以下操作:

java -cp build/;[other jars if they not in your classpath] org.apache.mahout.classifier.bayes.ZClassifier [YOUR OWN PARAMS]

the "build" dir could be "bin" based on the version of eclipse. 根据Eclipse的版本,“ build”目录可以是“ bin”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM