简体   繁体   English

是否可以使用没有hadoop依赖的apache mahout?

[英]is it possible to use apache mahout without hadoop dependency?

Is it possible to use Apache mahout without any dependency to Hadoop. 是否可以使用Apache mahout而不依赖于Hadoop。

I would like to use the mahout algorithm on a single computer by only including the mahout library inside my Java project but i dont want to use hadoop at all since i will be running on a single node anyway. 我想在单个计算机上使用mahout算法,只在我的Java项目中包含mahout库,但我根本不想使用hadoop,因为无论如何我将在单个节点上运行。

Is that possible? 那可能吗?

Yes. 是。 Not all of Mahout depends on Hadoop, though much does. 不是所有的Mahout都依赖于Hadoop,尽管很多。 If you use a piece that depends on Hadoop, of course, you need Hadoop. 如果您使用依赖于Hadoop的部分,当然,您需要Hadoop。 But for example there is a substantial recommender engine code base that does not use Hadoop. 但是,例如,有一个不使用Hadoop的实质性推荐引擎代码库。

You can embed a local Hadoop cluster/worker in a Java program. 您可以在Java程序中嵌入本地Hadoop集群/ worker。

Definitely, yes. 当然,是的。 In the Mahout Recommender First-Timer FAQ they advise against starting out with a Hadoop-based implementation (unless you know you're going to be scaling past 100 million user preferences relatively quickly). Mahout Recommender First-Timer FAQ中,他们建议不要使用基于Hadoop的实现(除非您知道您将相对快速地扩展超过1亿用户偏好)。

You can use the implementations of the Recommender interface in a pure-Java fashion relatively easily. 您可以相对轻松地以纯Java方式使用Recommender接口的实现。 Or place one in the servlet of your choice. 或者将一个放在您选择的servlet中。

Technically, Mahout has a Maven dependency on Hadoop. 从技术上讲,Mahout对Hadoop 依赖。 But you can use recommenders without the Hadoop JARs easily. 但您可以轻松使用没有Hadoop JAR的推荐器。 This is described in the first few chapters of Mahout in Action - you can download the sample source code and see how it's done - look at the file RecommenderIntro.java . 这在Mahout in Action的前几章中有所描述 - 您可以下载示例源代码并查看它是如何完成的 - 查看文件RecommenderIntro.java

However, if you're using Maven, you would need to exclude Hadoop manually - the dependency would look like this: 但是,如果您使用的是Maven,则需要手动排除Hadoop - 依赖关系如下所示:

<dependency>
        <groupId>org.apache.mahout</groupId>
        <artifactId>mahout-core</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-core</artifactId>
            </exclusion>
        </exclusions>
</dependency>

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

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