NMLS - 4. Recommender Systems - Content Based Filtering - Introductory Machine Learning
In 2022 I started the new Machine Learning Specialization by Andrew NG.
I completed it's first two courses in 2022. I'll share the jupyter notebooks from this specialization soon.
Now, in 2023 when I am finally free from my M1, I am going to complete the specialization. Here is the fourth Assignment of course 3 (last course) on Recommender Systems.
Procedure:
In Content based filtering, for a movie streaming website, we have a set of users and their ratings to the movies they watched. We can also create engineered features e.g, the average rating that a user gave to each genre.
We then have another dataset that contains all of the movies and their corresponding average ratings and their corresponding one-hot-encoded genres.
The users data is fed into a neural network. The movies data is fed into another neural network. Both neural networks can have different architects, but the final layer of each neural network must be identical to the other one.
The final layers give user and movie/item vectors. The dot product of these two vectors is our prediction.
Mean squared error cost function is used to simultaneously train both neural networks and to reduce the cost.
After training whenever we have a new user and he/she has watched some movies, we can use this information to create a user vector. We can take the product of this user vector with a fix number retrieved movie vectors and rank the movies according to their prediction magnitudes.
By calculating the distances between movie vectors we can also find which movies are most similar to each other.
Relevant github link (my github repo)
Comments
Post a Comment