The itembased algorithm based on Mahout
In fact, Mahout distributed only partially implemented the algorithm. For example, the recommendation algorithm item-based and Slopone have Hadoop implementation and single-machine version implementation, user-based no distributed implementation.
Mahout implemented algorithms (standalone and distributed editions)
Https://mahout.apache.org/users/basics/algorithms.html
In most cases, we just call the mahout algorithm, either standalone or distributed.
So how does Mahout's distributed algorithm call it?
In fact, there are two ways of mahout distributed algorithm invocation,
One is that the command line submits the Hadoop task,
One is a Java program that submits a Hadoop task.
1 command-line mode
./mahout Recommenditembased-ssimilarity_loglikelihood-i/home/linger/j2ee-workspace/linger/data/dataset.csv-o/ Home/linger/j2ee-workspace/linger/data/out.csv--numrecommendations 3
You can refer to the official documentation
Http://mahout.apache.org/users/recommender/intro-itembased-hadoop.html
2 Java program Call is actually the first copy of the data to HDFs, and then do the operation in Hadoop.
You can refer to this article
http://blog.fens.me/hadoop-mahout-mapreduce-itemcf/
Mahoutdevelopment of step-by-Steps programsItem-based collaborative filteringITEMCF
Ps:mahout has a hole, that is, the UID and Itemid must be long type.
You can refer to the following article to resolve
Mahout uid,pid for string type when recommended
http://blog.csdn.net/pan12jian/article/details/38703569
See here, you should think, for Mahout has implemented algorithm, call is very simple.
To be more near a floor, you must learn source code analysis and source modification, and finally learn to implement distributed algorithms based on Map-reduce.
Learn source code analysis and source modification, is to better use mahout, because sometimes need to according to their own specific needs to make adjustments, or even optimization.
Learn to implement distributed algorithms based on Map-reduce, because some algorithms mahout not implemented, so they have to develop their own.
This article link: http://blog.csdn.net/lingerlanlan/article/details/42087071
This article linger
Mahout Mahout-based itembased algorithm for getting Started Guide