• Stars
    star
    2,095
  • Rank 20,753 (Top 0.5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mirror of Apache Mahout

Welcome to Apache Mahout!

The goal of the Apache Mahout™ project is to build an environment for quickly creating scalable, performant machine learning applications.

For additional information about Mahout, visit the Mahout Home Page

Setting up your Environment

Whether you are using the Mahout- shell, running command line jobs, or using it as a library to build apps, you will need to set-up several environment variables. Edit your environment in ~/.bash_profile for Mac or ~/.bashrc for many Linux distributions. Add the following

export MAHOUT_HOME=/path/to/mahout
export MAHOUT_LOCAL=true # for running standalone on your dev machine, 
# unset MAHOUT_LOCAL for running on a cluster

You will need $JAVA_HOME, and if you are running on Spark, you will also need $SPARK_HOME.

Using Mahout as a Library

Running any application that uses Mahout will require installing a binary or source version and setting the environment. To compile from source:

  • mvn -DskipTests clean install
  • To run tests do mvn test
  • To set up your IDE, do mvn eclipse:eclipse or mvn idea:idea

To use Maven, add the appropriate setting to your pom.xml or build.sbt following the template below.

To use the Samsara environment you'll need to include both the engine neutral math-scala dependency:

<dependency>
    <groupId>org.apache.mahout</groupId>
    <artifactId>mahout-math-scala</artifactId>
    <version>${mahout.version}</version>
</dependency>

and a dependency for back end engine translation, e.g:

<dependency>
    <groupId>org.apache.mahout</groupId>
    <artifactId>mahout-spark</artifactId>
    <version>${mahout.version}</version>
</dependency>

Building From Source

Prerequisites:

Linux Environment (preferably Ubuntu 16.04.x) Note: Currently, only the JVM-only build will work on a Mac. gcc > 4.x NVIDIA Card (installed with OpenCL drivers alongside usual GPU drivers)

Downloads

Install java 1.7+ in an easily accessible directory (for this example, ~/java/) http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Create a directory ~/apache/.

Download apache Maven 3.3.9 and un-tar/gunzip to ~/apache/apache-maven-3.3.9/ . https://maven.apache.org/download.cgi

Download and un-tar/gunzip Hadoop 2.4.1 to ~/apache/hadoop-2.4.1/ . https://archive.apache.org/dist/hadoop/common/hadoop-2.4.1/

Download and un-tar/gunzip spark-1.6.3-bin-hadoop2.4 to ~/apache/ . http://spark.apache.org/downloads.html Choose release: Spark-1.6.3 (Nov 07 2016) Choose a package type: Pre-Built for Hadoop 2.4

Install ViennaCL 1.7.0+ If running Ubuntu 16.04+

sudo apt-get install libviennacl-dev

Otherwise if your distribution’s package manager does not have a viennniacl-dev package >1.7.0, clone it directly into the directory which will be included in when being compiled by Mahout:

mkdir ~/tmp
cd ~/tmp && git clone https://github.com/viennacl/viennacl-dev.git
cp -r viennacl/ /usr/local/
cp -r CL/ /usr/local/

Ensure that the OpenCL 1.2+ drivers are all installed (packed with most consumer-grade NVIDIA drivers). Not sure about higher-end cards.

Clone mahout repository into ~/apache.

git clone https://github.com/apache/mahout.git
Configuration

When building mahout for a spark backend, we need four System Environment variables set:

    export MAHOUT_HOME=/home/<user>/apache/mahout
    export HADOOP_HOME=/home/<user>/apache/hadoop-2.4.1
    export SPARK_HOME=/home/<user>/apache/spark-1.6.3-bin-hadoop2.4    
    export JAVA_HOME=/home/<user>/java/jdk-1.8.121

Mahout on Spark regularly uses one more env variable, the IP of the Spark clusters' master node (usually, the node hosting the session user).

To use four local cores (Spark master need not be running)

export MASTER=local[4]

To use all available local cores (again, Spark master need not be running)

export MASTER=local[*]

To point to a cluster with spark running:

export MASTER=spark://master.ip.address:7077

We then add these to the path:

   PATH=$PATH$:MAHOUT_HOME/bin:$HADOOP_HOME/bin:$SPARK_HOME/bin:$JAVA_HOME/bin

These get appended to the users' ~/.bashrc file.

Building Mahout with Apache Maven

Currently, Mahout has three builds. From the $MAHOUT_HOME directory, we may issue the commands to build each using mvn profiles.

JVM only:

mvn clean install -DskipTests

JVM with native OpenMP level 2 and level 3 matrix/vector Multiplication

mvn clean install -Pviennacl-omp -Phadoop2 -DskipTests

JVM with native OpenMP and OpenCL for Level 2 and level 3 matrix/vector Multiplication. (GPU errors fall back to OpenMP, and currently, only a single GPU/node is supported).

mvn clean install -Pviennacl -Phadoop2 -DskipTests

Testing the Mahout Environment

Mahout provides an extension to the spark-shell that is good for getting to know the language, testing partition loads, prototyping algorithms, etc.

To launch the shell in local mode with two threads - simply do the following:

$ MASTER=local[2] mahout spark-shell

After a very verbose startup, a Mahout welcome screen will appear:

Loading /home/andy/sandbox/apache-mahout-distribution-0.13.0/bin/load-shell.scala...
import org.apache.mahout.math._
import org.apache.mahout.math.scalabindings._
import org.apache.mahout.math.drm._
import org.apache.mahout.math.scalabindings.RLikeOps._
import org.apache.mahout.math.drm.RLikeDrmOps._
import org.apache.mahout.sparkbindings._
sdc: org.apache.mahout.sparkbindings.SparkDistributedContext = org.apache.mahout.sparkbindings.SparkDistributedContext@3ca1f0a4

                _                 _
_ __ ___   __ _| |__   ___  _   _| |_
 '_ ` _ \ / _` | '_ \ / _ \| | | | __|
 | | | | (_| | | | | (_) | |_| | |_
_| |_| |_|\__,_|_| |_|\___/ \__,_|\__|  version 0.13.0


That file does not exist


scala>

At the scala> prompt, enter:

scala> :load /home/<andy>/apache/mahout/examples
                               /bin/SparseSparseDrmTimer.mscala

Which will load a matrix multiplication timer function definition. To run the matrix timer:

        scala> timeSparseDRMMMul(1000,1000,1000,1,.02,1234L)
            {...} res3: Long = 16321

Note the 14.1 release is missing a class required for this will be fixed in 14.2. We can see that the JVM only version is slow, thus our motive for GPU and Native Multithreading support.

To understand the processes getting performed under the hood of the timer, we may examine the .mscala (mahout scala) code that is both fully functional scala and the Mahout R-Like DSL for tensor algebra:




def timeSparseDRMMMul(m: Int, n: Int, s: Int, para: Int, pctDense: Double = .20, seed: Long = 1234L): Long = {
  val drmA = drmParallelizeEmpty(m , s, para).mapBlock(){
       case (keys,block:Matrix) =>
           val R =  scala.util.Random
           R.setSeed(seed)
           val blockB = new SparseRowMatrix(block.nrow, block.ncol)
           blockB := {x => if (R.nextDouble < pctDense) R.nextDouble else x }
       (keys -> blockB)
  }

  val drmB = drmParallelizeEmpty(s , n, para).mapBlock(){
       case (keys,block:Matrix) =>
           val R =  scala.util.Random
           R.setSeed(seed + 1)
           val blockB = new SparseRowMatrix(block.nrow, block.ncol)
           blockB := {x => if (R.nextDouble < pctDense) R.nextDouble else x }
       (keys -> blockB)
  }

  var time = System.currentTimeMillis()

  val drmC = drmA %*% drmB
 
  // trigger computation
  drmC.numRows()

  time = System.currentTimeMillis() - time

  time  
 
}

For more information, please see the following references:

http://mahout.apache.org/users/environment/in-core-reference.html

http://mahout.apache.org/users/environment/out-of-core-reference.html

http://mahout.apache.org/users/sparkbindings/play-with-shell.html

http://mahout.apache.org/users/environment/classify-a-doc-from-the-shell.html

Note that due to an intermittent out-of-memory bug in a Flink-based test, we have disabled it from the binary releases. To use Flink, please uncomment the line in the root pom.xml in the <modules> block, so it reads <module>flink</module>.

Examples

For examples of how to use Mahout, see the examples directory located in examples/bin

For information on how to contribute, visit the How to Contribute Page

Legal

Please see the NOTICE.txt included in this directory for more information.

Build Status

More Repositories

1

echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
TypeScript
56,321
star
2

superset

Apache Superset is a Data Visualization and Data Exploration Platform
TypeScript
55,051
star
3

dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
Java
39,376
star
4

spark

Apache Spark - A unified analytics engine for large-scale data processing
Scala
36,719
star
5

airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
Python
33,564
star
6

kafka

Mirror of Apache Kafka
Java
26,881
star
7

incubator-seata

🔥 Seata is an easy-to-use, high-performance, open source distributed transaction solution.
Java
24,602
star
8

skywalking

APM, Application Performance Monitoring System
Java
22,610
star
9

flink

Apache Flink
Java
22,197
star
10

mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
C++
20,572
star
11

shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Java
19,020
star
12

rocketmq

Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
Java
18,578
star
13

brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
C++
14,261
star
14

incubator-weex

Apache Weex (Incubating)
C++
13,884
star
15

hadoop

Apache Hadoop
Java
13,855
star
16

arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
C++
13,130
star
17

pulsar

Apache Pulsar - distributed pub-sub messaging system
Java
13,062
star
18

druid

Apache Druid: a high performance real-time analytics database.
Java
12,843
star
19

predictionio

PredictionIO, a machine learning server for developers and ML engineers.
Scala
12,556
star
20

zookeeper

Apache ZooKeeper
Java
11,532
star
21

apisix

The Cloud-Native API Gateway
Lua
11,031
star
22

incubator-answer

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
Go
10,948
star
23

doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
Java
10,720
star
24

thrift

Apache Thrift
C++
9,900
star
25

dolphinscheduler

Apache DolphinScheduler is the modern data workflow orchestration platform with powerful user interface, dedicated to solving complex task dependencies in the data pipeline and providing various types of jobs available `out of the box`
Java
9,619
star
26

cassandra

Mirror of Apache Cassandra
Java
8,187
star
27

shardingsphere-elasticjob

Distributed scheduled job
Java
7,965
star
28

tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
Python
7,828
star
29

shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
Java
7,541
star
30

beam

Apache Beam is a unified programming model for Batch and Streaming data processing.
Java
7,364
star
31

jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
Java
7,335
star
32

tomcat

Apache Tomcat
Java
6,926
star
33

storm

Apache Storm
Java
6,480
star
34

zeppelin

Web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala and more.
Java
6,162
star
35

openwhisk

Apache OpenWhisk is an open source serverless cloud platform
Scala
6,130
star
36

couchdb

Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
Erlang
5,810
star
37

incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
Java
5,542
star
38

dubbo-spring-boot-project

Spring Boot Project for Apache Dubbo
Java
5,355
star
39

iceberg

Apache Iceberg
Java
5,199
star
40

mesos

Apache Mesos
Java
5,111
star
41

hive

Apache Hive
Java
5,053
star
42

camel

Apache Camel is an open source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data.
Java
5,042
star
43

groovy

Apache Groovy: A powerful multi-faceted programming language for the JVM platform
Java
4,977
star
44

hbase

Apache HBase
Java
4,971
star
45

incubator-weex-ui

🏄 A rich interaction, lightweight, high performance UI library based on Weex.
Vue
4,788
star
46

pinot

Apache Pinot - A realtime distributed OLAP datastore
Java
4,766
star
47

ignite

Apache Ignite
Java
4,548
star
48

rocketmq-externals

Mirror of Apache RocketMQ (Incubating)
Java
4,474
star
49

seatunnel

SeaTunnel is a distributed, high-performance data integration platform for the synchronization and transformation of massive data (offline & real-time).
Java
4,459
star
50

incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
C++
4,381
star
51

lucene-solr

Apache Lucene and Solr open-source search software
4,349
star
52

dubbo-go

Go Implementation For Apache Dubbo
Go
4,315
star
53

shiro

Apache Shiro
Java
4,164
star
54

calcite

Apache Calcite
Java
4,028
star
55

nifi

Apache NiFi
Java
4,006
star
56

maven

Apache Maven core
Java
3,836
star
57

hudi

Upserts, Deletes And Incremental Processing on Big Data.
Java
3,804
star
58

dubbo-admin

The ops and reference implementation for Apache Dubbo
Java
3,707
star
59

incubator-heron

Apache Heron (Incubating) is a realtime, distributed, fault-tolerant stream processing engine from Twitter
Java
3,646
star
60

cordova-android

Apache Cordova Android
JavaScript
3,539
star
61

kylin

Apache Kylin
Java
3,526
star
62

httpd

Mirror of Apache HTTP Server. Issues: http://issues.apache.org
C
3,318
star
63

linkis

Apache Linkis builds a computation middleware layer to facilitate connection, governance and orchestration between the upper applications and the underlying data engines.
Java
3,198
star
64

incubator-kie-optaplanner

AI constraint solver in Java to optimize the vehicle routing problem, employee rostering, task assignment, maintenance scheduling, conference scheduling and other planning problems.
Java
3,152
star
65

logging-log4j2

Apache Log4j 2 is a versatile, feature-rich, efficient logging API and backend for Java.
Java
3,151
star
66

iotdb

Apache IoTDB
Java
3,000
star
67

arrow-datafusion

Apache Arrow DataFusion SQL Query Engine
Rust
2,998
star
68

curator

Apache Curator
Java
2,997
star
69

singa

a distributed deep learning platform
C++
2,968
star
70

incubator-streampark

StreamPark, Make stream processing easier! easy-to-use streaming application development framework and operation platform
Scala
2,820
star
71

nutch

Apache Nutch is an extensible and scalable web crawler
Java
2,653
star
72

guacamole-server

Mirror of Apache Guacamole Server
C
2,601
star
73

avro

Apache Avro is a data serialization system.
Java
2,571
star
74

commons-lang

Apache Commons Lang
Java
2,539
star
75

incubator-fury

A blazing fast multi-language serialization framework powered by JIT and zero-copy.
Java
2,497
star
76

netbeans

Apache NetBeans
Java
2,492
star
77

flume

Mirror of Apache Flume
Java
2,458
star
78

incubator-devlake

Apache DevLake is an open-source dev data platform to ingest, analyze, and visualize the fragmented data from DevOps tools, extracting insights for engineering excellence, developer experience, and community growth.
Go
2,346
star
79

geode

Apache Geode
Java
2,244
star
80

incubator-seata-samples

seata-samples
Java
2,196
star
81

maven-mvnd

Apache Maven Daemon
Java
2,191
star
82

activemq

Mirror of Apache ActiveMQ
Java
2,184
star
83

gobblin

A distributed data integration framework that simplifies common aspects of big data integration such as data ingestion, replication, organization and lifecycle management for both streaming and batch data ecosystems.
Java
2,165
star
84

incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
Java
2,156
star
85

parquet-mr

Apache Parquet
Java
2,153
star
86

incubator-kvrocks

Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
C++
2,147
star
87

pdfbox

Mirror of Apache PDFBox
Java
2,131
star
88

cordova-ios

Apache Cordova iOS
JavaScript
2,130
star
89

lucenenet

Apache Lucene.NET
C#
2,031
star
90

ambari

Apache Ambari simplifies provisioning, managing, and monitoring of Apache Hadoop clusters.
Java
1,990
star
91

libcloud

Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API.
Python
1,956
star
92

tika

The Apache Tika toolkit detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF).
Java
1,860
star
93

drill

Apache Drill is a distributed MPP query layer for self describing data
Java
1,841
star
94

dubbo-samples

samples for Apache Dubbo
Java
1,839
star
95

servicecomb-java-chassis

ServiceComb Java Chassis is a Software Development Kit (SDK) for rapid development of microservices in Java, providing service registration, service discovery, dynamic routing, and service management features
Java
1,829
star
96

tinkerpop

Apache TinkerPop - a graph computing framework
Java
1,825
star
97

bookkeeper

Apache BookKeeper - a scalable, fault tolerant and low latency storage service optimized for append-only workloads
Java
1,785
star
98

rocketmq-spring

Apache RocketMQ Spring Integration
Java
1,775
star
99

kudu

Mirror of Apache Kudu
C++
1,743
star
100

poi

Mirror of Apache POI
Java
1,704
star