Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the collaborative filtering based on itemBase?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

What is the collaborative filtering based on itemBase? I believe many inexperienced people are at a loss about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

I. what is collaborative filtering

To take a simple example, when we shop online, when we buy an item A, the website basically makes such a prompt, and the person who buys the item also buys it. Then there is a list of recommendations, which is typical of collaborative filtering. How exactly is this achieved? The following is an example of my own implementation of collaborative filtering.

2. Principle of algorithm

Collaborative filtering based on item evaluates the similarity between item through the scores of different item, and makes recommendations based on the similarity between item. To put it simply: recommend to the user items that are similar to the items he liked before.

When recommending to user C who purchased item A, item An and item B appear together in user B once, and item An and item C appear twice in user An and B. therefore, the similarity between item An and C is greater than that between item An and B, so item C is recommended to user C.

So, the question is, if user C shows a greater preference for item B than for item C, should we recommend item B or C when we make a recommendation to user C?

3. Matrix model

In order to solve the above problems, the user evaluation moment matrix is introduced. (above) on the left is the co-occurrence matrix of the item, and in the middle is the user's score matrix of the item, so that there are two dimensions: the similarity between the items and the user's preference for the item, and the two matrices are multiplied to get the recommendation matrix of the item. The higher the similarity between items, the greater the corresponding value on the left; the greater the user's preference for items, the greater the corresponding value in the user rating matrix; and finally, the greater the product of the two, the higher the score in the recommendation matrix, the greater the recommendation.

IV. Implementation steps

Establish the co-occurrence matrix of items

Establish a user's scoring matrix for items

The recommended result matrix is calculated.

Recommendation result matrix = co-occurrence matrix of items * user's score matrix for items

Filtering and sorting

5. Job process and data format of mapreduce

The second job: calculate the number of co-occurrence of items and get the co-occurrence matrix of items.

The third job: the user's score matrix (the user's score of the item is obtained according to the user's click, collection, purchase, etc., and the specific score is customized according to the specific situation)

The fourth job: Matrix multiplication to get the recommendation matrix

Fifth job: filtering (filtering out purchased item) and sorting (descending)

After reading the above, have you mastered the method of collaborative filtering based on itemBase? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report