MoTEA 寫:
小弟是初次接觸hadoop以及mahout,其中有些問題想請教各先進
1.Hadoop環境建立後,如何執行Mahout內的任一範例(如 Fuzzy kmeans clustering)
2.我是否能將Mahout於Windoop上執行?怎麼做?以及上述之問題
有勞各位先進位小弟解答,給小弟有個方向。
感謝各位
1. 建議看一下 Mahout in Action
http://www.manning.com/owen/ Fuzzy K-Means 的跑法底下有該書試閱章節:
http://www.oracle.com/technetwork/community/bookstore/mahout-sample-523386.pdf http://tuxdna.in/files/notes/mahout.html https://mahout.apache.org/users/clustering/k-means-clustering.html我找到最簡單的方式是下載範例 Shell Script , 取代 Mahout 安裝路徑(因為我是用 CDH4.7 )
代碼:
### 下載 cluster-reuters.sh
[root@master ~]# wget https://raw.githubusercontent.com/apache/mahout/master/examples/bin/cluster-reuters.sh
### 修改 mahout 的安裝路徑 ( 因為原本的 script 是給 mahout tar.gz 用的 )
[root@master ~]# sed -i 's#../../bin/mahout#$(which mahout)#' cluster-reuters.sh
### 移除不支援的參數 - 因為我用 CDH4.7 Mahout 0.7 跑的, 如果用 Mahout 0.9 就不用取代這個參數
[root@master ~]# sed -i 's#-xm sequential##g' cluster-reuters.sh
### 執行 cluster-reuters.sh
[root@master ~]# bash cluster-reuters.sh
### 程式會問你要跑哪一種分群
Please select a number to choose the corresponding clustering algorithm
1. kmeans clustering
2. fuzzykmeans clustering
3. lda clustering
4. streamingkmeans clustering
Enter your choice : 1
ok. You chose 1 and we'll use kmeans Clustering
creating work directory at /tmp/mahout-work-root
Converting to Sequence Files from Directory
2. 就我理解, Windoop 沒有包 Mahout 在裏面
- Jazz