From the course: Machine Learning and AI Foundations: Recommendations

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Make recommendations for existing users

Make recommendations for existing users

From the course: Machine Learning and AI Foundations: Recommendations

Start my 1-month free trial

Make recommendations for existing users

- [Voiceover] Let's talk about the best way to put our recommendations system to use in the real world. Let's open up train reccommender dot py. This file contains the code to factor our review data set. We read the data set using the read csv function, then we create the ratings matrix using the pivot table function, factor the matrix to create U and M, and then multiply U and M to get the predicted ratings. Since our movie review data set is fairly small, this process runs pretty quickly. But with a larger data set, the factoring process can take several minutes, or even hours to run. We don't have to factor the matrix every time we want to make a user recommendation. Instead, it's a lot more practical to factor the matrix once, and save the resulting model to a file. Then, we can use those files later to make recommendations without needing to perform any slow calculations. Python provides a feature for easily saving and loading data from files called Pickle. So at the bottom here,…

Contents