Data Mining 1-Introduction to recommended algorithms

Source: Internet
Author: User

Find similar users

1. Manhattan Distance: Fast computing, very advantageous for Facebook to calculate the similarity between millions of users

The simplest way to calculate distance is Manhattan distance. In a two-dimensional model, everyone can be represented by dots (x, y), where I use subscripts to denote different people, (x1, y1) that Amy, (x2, y2) represents the mysterious Mr. X, then the distance between them is:

We can best recommend to Mr. X the results of the smallest results (distance closest).

2. Euclidean distance:

3. Minkowski Distance:

We can generalize the Manhattan distance and Euclidean distance into a formula called Minkowski distance:

which

    • r = 1The formula is the Manhattan distance
    • r = 2The formula is Euclidean distance.
    • r = ∞Maximum Distance

The larger the R value, the greater the difference in size of a single dimension will have on the overall distance.

4. Pearson correlation coefficient

Let's take a closer look at the user rating of the band and find that each user's scoring criteria are very different:

    • Bill did not hit the extreme score, which was between 2 and 4 points;
    • Jordyn seemed to like all the bands, scoring between 4 and 5;
    • Hailey is an interesting person, his score is not 1 is 4.

So, how do you compare these users? For example, does the Hailey 4 point equal to Jordan's 4 points or 5 points? I think it's closer to 5 points. This will affect the accuracy of the referral system. One solution is to use Pearson correlation coefficients.

The Pearson correlation coefficient is calculated as:

Ability to calculate the approximate value of Pearson's correlation coefficients:

Data Mining 1-Introduction to recommended algorithms

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.