[Recommendation System] collaborative filtering-data cleaning under highly sparse data (Pearson correlation coefficient)

Source: Internet
Author: User


Similarity between vectors

There are many ways to measure the similarity between vectors. You can use the reciprocal of distance (various distances), vector angle, Pearson correlation coefficient, and so on.

Pearson correlation coefficient calculation formula is as follows:

The numerator is the covariance, And the numerator is the product of the standard deviation of two variables. Obviously, the standard deviation of X and Y cannot be 0.

Because, the Pearson correlation coefficient calculation formula can also be written:

When the linear relationship between two variables is enhanced, the correlation coefficient tends to 1 or-1.

User rating Prediction

The basic principles of user scoring prediction are:

Step 1. If user I does not comment too much on Project J, find the K neighbors most similar to user I (using vector similarity measurement)

Step2. then, the weighted average of the scores of the K neighbors on the Project J is used to predict the user I's score on the Project J.

  Iterm1 ............ Itemn
User1 R11   R1n
......   Rij  
Userm Rm1   Rmn

User rating data matrix

Step1.

The user rating matrix is a highly sparse matrix, that is, the user does not score many projects. The traditional vector similarity measurement method is used to measure the similarity between two users in a highly sparse manner. A simple solution is to make all the unrated items equal to the average score of the user.

A better way to measure the similarity between user I and user J is:

1. Set User I to participate in the scoring project set to II, Set User J to participate in the scoring project set to IJ, and find their Union set.

2. items in which user I is not rated are re-evaluated for each item in user I.

. Retrieve the two columns of the scoring matrix and calculate the similarity between the two columns .. Find the most similar set of V projects.

2.2.

3. In this way, both user I and j have a non-zero score. In this case, their similarity is calculated.

Step2.

Indicates the average rating of user U for all the items that have been scored.



Reference:

Http://zh.wikipedia.org/wiki/%E7%9A% AE %E5%B0%94%E9%80%8A%E7%A7%AF%E7%9F%A9%E7%9B%B8%E5%85%B3%E7%B3%BB%E6%95%B0

Http://www.cnblogs.com/zhangchaoyang/articles/2664366.html

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.