Mahout recommendation 9-Recommendation

Source: Internet
Author: User

User-based recommendations and item-based recommendations

The two algorithms depend on the similarity measurement (same-sex definition) between two things (users or items). The similarity measurement method is pearsoncorrealation Pearson correlation coefficient and the log likelihood value loglikelihood, the Pearson correlation coefficient is short mancorrelation, and the grain coefficient is tanimotocoefficient.

Recommendation algorithm: slope-one, based on SVD and clustering recommendation algorithm.

User-based recommendations:

Sample Code:

Public static void main (string [] ARGs) throws exception {// load data files for storage and provide all the preferences required for computing, user and item data datamodel model = new filedatamodel (new file ("Data/intro.csv"); // user similarity, which gives the similarity between two users and has multiple measurement methods, it encapsulates the concept of user similarity usersimilarity similarity = new pearsoncorrelationsimilarity (model); // user neighbor, a group of users most similar to a given user, encapsulates the concept of the most similar user group userneighborhood neighborhood = new feature (2, similarity, model); // The recommendation engine merges these components to recommend recommender = new genericuserbasedrecommender (model, neighborhood, similarity); // recommended item 1, 1, and list for user 1 <recommendeditem> recommendeditems = recommender. recommend (1, 1); // output for (recommendeditem item: recommendeditems) {system. out. println (item );}}

When a new similarity measure is introduced, the results will change significantly. Mahout recommendation is composed of multiple components, rather than a single recommendation engine. The combination of other components can be customized to provide ideal recommendations for specific applications.

1. Data Model with datamodel implementation

2. User similarity measurement, implemented by usersimilarity

3. User neighbor definition, with userneighborhood implementation

4. recommendation engine, implemented by a recommender (genericuserbasedrecommender here)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.