Machine Learning Recommendation System _ Machine learning

Source: Internet
Author: User

We start with an example to define the problem of the recommendation system.
If we were a film supplier, we had 5 movies and 4 users, and we asked users to rate the movie.

Content-based recommendation system

In a content-based recommendation system algorithm, we assume that we have some data on what we want to recommend, and that this data is about the characteristics of these things.
In our example, we can assume that each film has two characteristics, such as X1 represents the romantic extent of the film, X2 represents the degree of motion of the film.

I:r (I,J) said that we only counted the films that user J rated too much. In a general linear regression model, the error term and the return item should all be multiplied by 1/2m, where we remove M. And we do not the other side of the θ0 to deal with normalization.

The cost function above is for only one user, and in order to learn all users, we sum the cost functions of all users:

Collaborative filtering
In the previous Content-based recommendation system, for each movie, we have mastered the features available, using these features to train each user's parameters. Conversely, if we have user parameters, we can learn the characteristics of the film.

Note: In collaborative filtering from the algorithm, we usually do not use variance terms, if necessary, the algorithm will automatically learn. The Cooperative filtering algorithm uses the following steps:
1. Initial x (1), X (2),..., x (nm), θ (1), θ (2),..., θ (nu) as random decimal values
2. Use gradient descent algorithm to minimize cost function
3. After the training algorithm is completed, we predict (θ (j)) Tx (i) for user J to give the movie I a rating

The feature matrix obtained through this learning process contains important data about the movie, which is not always readable.
Understand, but we can use these data as a basis for recommending films to users. For example, if a user is watching a movie x (i), we can look for another movie X (j), based on two movies
Distance between eigenvectors X (i) −x (j) | | The size.

To quantify: low rank matrix decomposition
In the last few videos, we talked about collaborative filtering algorithms, and in this video I'll talk about the quantization implementation of the algorithm and other things you can do about the algorithm.

Give examples:
1. When giving a product, you can find other products related to it.
2. A user recently saw a product, there are no other related products, you can recommend to him.

What I'm going to do is: implement a choice method and write out the prediction of the collaborative filtering algorithm.
We have a dataset about five movies, and what I'm going to do is to score and group the movies for these users.
into a matrix.

We have five movies and four users, so this matrix Y is a 5 row, 4 column matrix, which
The user rating data for some films are in The matrix:

Normalization of the mean value


Then we use this new Y-matrix to train the algorithm. If we're going to use the newly trained algorithm to predict the score, we need to add the mean back, and predict (θ (j)) T (x (i)) +μi for Eve, our new model would think that she gave each film a score of the movie's average.

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.