Andrew Ng "machine learning" Course summary (16) _ recommendation system

16.1 Formal problem

The reason (1) speaking recommendation system the following main points:

1. The recommendation system is a very important application of machine learning, although a lower proportion of the academic world, but it is very important in commercial applications, occupies a high priority.

2. The machine learning to convey a big idea: the characteristics can be learned from, and does not require manual to choose.

(2) Case Description: The movie recommendation system

Want to create an algorithm to predict how many points everyone could have seen the movie they did not fight, and as a recommended basis.

(3) In some of the tags is introduced:

n- U represents the number of users,

n- m represents the number of movies,

r (i, j) j to the user if the film is rated by i r (i, j) = 1,

the y- (i, j) represents the j user to play a movie score,

m J represents the total number of user ratings of the film.

16.2 content-based recommendation system

(1) Summary: Based on the content of the movie it is actually already have the characteristics of X, and then find the parameter θ fit, based on the user mentioned later, it is already parameter θ, seeking to fit the movie features X.

(2) assuming known characteristics of each film (based on content):

Parameters: [theta] (j) a parameter indicative of user j, X (i) represents the characteristics of film i,

For users and movie j i, we predict the score is: ([theta] (j) ) Tx (i)

For single-user cost function ( omitted in sample number m, for [theta] 0 is not regularized, the score is calculated only ) as follows:

Therefore, the cost function for all users to:

Gradient descent update method Gradient formula:

16.3 collaborative filtering

(1) based on the user (i.e. the known User parameters θ, characteristic of films seek x), with the cost function is:

(2) neither is the collaborative filtering algorithm known characteristic X, while not know the user to optimize both parameters θ.

The cost function is:

Of the partial derivative of the cost function:

(3) a collaborative filtering algorithm steps:

1. Initialize X (. 1) , X (2) , ......, X (n- m ) , [theta] (. 1) , [theta] (. 1) , ......, [theta] (n- U ) for a number of small random values;

2. using a gradient descent algorithm to minimize the cost function;

3. After training algorithm, we forecast ([theta] (j) ) T the X- (i) for users to rate movies i j's.

(4) how to give users recommend:

1. The calculated score, the higher the Movie Rating to the user;

2. If you watch a movie, a movie based on the similarity between computing features, like a movie recommended to the user.

16.4 collaborative filtering algorithm

16.5 vectorization: low-rank matrix decomposition

The data set is stored in a matrix score -> obtained was filtered through a collaborative learning elements ([theta] (J) ) T X (I) in the prediction matrix -> seek similarities between the movie to movie characteristic distance

16.6 details of the implementation of the work

Summary: how recommended movies (will average score for each movie as the user's score) to new users

(1) User rating data as well as new users Eve:

(2) do for each movie mean normalization, then trained as a data model

(3) plus the value of the predicted mean the movie is the final score of the film:

(4) Average learned model will each movie as a new user ratings of the film.

Guess you like

Origin www.cnblogs.com/henuliulei/p/11289826.html